PROC GLM - class statement

Accepted Solution Solved
Reply
Contributor
Posts: 72
Accepted Solution

PROC GLM - class statement

I want to apply regression like proc glm

my model is 

bdr = family tangibility LnTA MB;

my question is i want to apply year fixed effect and industry fixed effect separately, my data include years from 2006-2010.

What should i do for that?


Accepted Solutions
Solution
‎11-30-2016 07:15 PM
SAS Super FREQ
Posts: 3,615

Re: PROC GLM - class statement

What do you mean by "apply separately"? Do you want to run two models? Do you want to run a nested model? If you want to run two models, you need to call PROC GLM twice. Both examples are shown below:

 

/* single models */
proc glm data=sashelp.bweight plots=none;
class  momedlevel;
model weight = momedlevel momwtgain;
quit;

proc glm data=sashelp.bweight plots=none;
class boy;
model weight = boy momwtgain;
quit;

/* nested model */
proc glm data=sashelp.bweight plots=none;
class momedlevel boy;
model weight = boy momedlevel momedlevel(boy) momwtgain;
quit;

View solution in original post


All Replies
Super User
Posts: 18,984

Re: PROC GLM - class statement

If you have fixed and random effects should you be using PROC MIXED instead?

Solution
‎11-30-2016 07:15 PM
SAS Super FREQ
Posts: 3,615

Re: PROC GLM - class statement

What do you mean by "apply separately"? Do you want to run two models? Do you want to run a nested model? If you want to run two models, you need to call PROC GLM twice. Both examples are shown below:

 

/* single models */
proc glm data=sashelp.bweight plots=none;
class  momedlevel;
model weight = momedlevel momwtgain;
quit;

proc glm data=sashelp.bweight plots=none;
class boy;
model weight = boy momwtgain;
quit;

/* nested model */
proc glm data=sashelp.bweight plots=none;
class momedlevel boy;
model weight = boy momedlevel momedlevel(boy) momwtgain;
quit;
☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 272 views
  • 0 likes
  • 3 in conversation