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

I know PROC SURVEYREG can incorporate clustering and fixed effects. However, I'm a bit confused as to how to include fixed effects. My understanding is, the CLASS command creates dummy variables for the categorization variable / fixed effect variable. But do I then include that variable in the model command?

 

For example, let's say var2 is my fixed effect. Do I...

 

proc surveyreg data=data;
class var2;
model y = var1 / solution;
run;

Or do I...

proc surveyreg data=data;
class var2;
model y = var1 var2 / solution;
run;

I think it is the second one, but running the first one does not provide the same coefficient estimates as if I run it without the CLASS command, so the CLASS command must be doing something other than just creating dummy variables?

 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
PGStats
Opal | Level 21

Look at the Data Summary Table. Most likely, including the CLASS statement decreases the Number of Observations count. Missing class levels are excluded from analysis, even if they are not part of the model.

 

Example:

 

data classMissing12;
set sashelp.class;
if age=12 then call missing(age);
run;

proc surveyreg data=classMissing12;
class age;
model weight = height / solution;
run;

proc surveyreg data=classMissing12;
*class age;
model weight = height / solution;
run;
PG

View solution in original post

1 REPLY 1
PGStats
Opal | Level 21

Look at the Data Summary Table. Most likely, including the CLASS statement decreases the Number of Observations count. Missing class levels are excluded from analysis, even if they are not part of the model.

 

Example:

 

data classMissing12;
set sashelp.class;
if age=12 then call missing(age);
run;

proc surveyreg data=classMissing12;
class age;
model weight = height / solution;
run;

proc surveyreg data=classMissing12;
*class age;
model weight = height / solution;
run;
PG

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 4491 views
  • 1 like
  • 2 in conversation