BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
liyongkai800
Obsidian | Level 7

 

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.

1 ACCEPTED SOLUTION

Accepted Solutions
arthurcavila
Obsidian | Level 7

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;

View solution in original post

2 REPLIES 2
arthurcavila
Obsidian | Level 7

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;

liyongkai800
Obsidian | Level 7
Thanks, it's good to know

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 751 views
  • 0 likes
  • 2 in conversation