I am wondering is there any way to generate the interaction by groups.
say the following program generates the effects x1,x2 and x1*x2 :
proc glmselect;
effect poly = polynomial(x1-x2/degree=2 mdegree=1);
model y = poly/selection=none;
run;
However, if I have x1,x2,y1,y2 and want to generate the effects x1,x2,x1*x2,y1,y2 and y1*y2, how to modify the effect statement? Thanks.
You can add a second effect statement, but it is a lot easier to modify your model statement instead.
proc glmselect data = sashelp.baseball;
effect poly = polynomial(nhits nrbi / degree = 2 mdegree = 1);
effect poly2 = polynomial(nouts nerror / degree = 2 mdegree = 1);
model logsalary = poly poly2 / selection = none;
run;
proc glmselect data = sashelp.baseball;
model logsalary = nhits|nrbi nouts|nerror / selection=none;
run;
You can add a second effect statement, but it is a lot easier to modify your model statement instead.
proc glmselect data = sashelp.baseball;
effect poly = polynomial(nhits nrbi / degree = 2 mdegree = 1);
effect poly2 = polynomial(nouts nerror / degree = 2 mdegree = 1);
model logsalary = poly poly2 / selection = none;
run;
proc glmselect data = sashelp.baseball;
model logsalary = nhits|nrbi nouts|nerror / selection=none;
run;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.