2
votes

Suppose I want to model Y on w, z and the interaction of w and z. PROC REG wants me to make a new variable, u=w*z, and then do a regression on w,z, and u

Isn't there some other proc that is less restrictive, where I could just specify w*z as variable to the regression, like I do in R?

3
I would look at PROC GLMSELECT, though I'm not an expert in regression. This part of the documentation might also be helpful.Joe

3 Answers

1
votes

Try PROC MODEL from SAS/ETS.

proc model data=foo;

y = int + Bw*w + Bz*z + Bwz*w*z;

fit y;
quit;
1
votes

Use the | to delimit your variables. You can specify the depth on interaction terms by using @. This will do all interaction terms, in this case the model would be height+ age + height*age.

proc glm data=sashelp.class;
model weight = height|age;
run;quit;

This will only do first order terms, i.e. no interaction

proc glm data=sashelp.class;
model weight = height|age @1;
run;quit;
0
votes