1

I am using proc transreg to test different transformations in the sashelp.baseball dataset. I request all plots and sometimes I can see a curve fit graph and sometimes I can't. Is there something I am missing if I want to output the regression fit with the code below?

DATA BASEBALL;
    SET SASHELP.BASEBALL;
RUN;

ODS GRAPHICS ON;
ODS OUTPUT
    NObs = num_obs
    FitStatistics = fitstat
    Coef = params
    ;
PROC TRANSREG
    DATA=BASEBALL
    PLOTS=ALL
    SOLVE
    SS2
    PREDICTED;
    ;
    MODEL_1:
        MODEL POWER(logsalary/parameter=1) = log(nruns);
            OUTPUT OUT = fitted_model;
RUN;

For clarity, the regression fit plot is a scatter plot with the estimated regression line fitted through

78282219
  • 85
  • 1
  • 8

1 Answers1

0

The fit plot is generated when the dependent variable does not have a transformation. You can create the transformation ahead of time to get this graph then.

From documentation:

ODS Graph Name: FitPlot

Plot Description: Simple Regression and Separate Group Regressions

Statement and Option: MODEL, a dependent variable that is not transformed, one non-CLASS independent variable, and at most one CLASS variable

This code works for me:

PROC TRANSREG
    DATA=sashelp.BASEBALL
    PLOTS=ALL
    SOLVE
    SS2
    PREDICTED;
    ;
    MODEL_1:
        MODEL identity(logsalary) = log(nruns);
            OUTPUT OUT = fitted_model;
RUN;

And generates the desired graph.

enter image description here

Reeza
  • 20,510
  • 4
  • 21
  • 38
  • Ahh, makes sense - I was hoping that power(dependent_var/parameter=1) would not be considered a transformation. Thank you – 78282219 Feb 20 '19 at 09:51