BookmarkSubscribeRSS Feed
KarimaTouati
Obsidian | Level 7

Hello, 

I am beginner to deal with Proc GLM and I am trying to apply this model :

m3.PNG

with this SAS code : 

PROC SORT
	DATA=TAB2 (keep= Country Sex Age Group year EmployPop EUfshare ImmiShare bar_ent )
	OUT=Sorted_TAB2;
	BY group;  /*when using group returns the same result */
RUN;

TITLE "Model M3";
Proc GLM Data=sorted_Tab2;
model EmployPop=EUfshare bar_ent*ImmiShare/ solution CLPARM alpha=0.05;
By Group ; run;
quit;

I don't know if the above code give me that kind of combinnation or I need to run two regressions ?

And How can I obtain the restricted and unrestricted RSS?

Thank you in advance.

2 REPLIES 2
Reeza
Super User

Somethings that jump out to me. 

 

1. Your model variable names don't align with the variable names in your code and we cannot know that. 

2. Your sort outputted data is called Sorted_tab2 but in the GLM proc you use TAB2 as your input data. You may want to change that to sorted_tab2. 

3. Your model doesn't look like it requires BY groups - that's when you want to run independent models for different groups entirely - for example creating a model for US and China entirely separately. If you want a dummy type variable instead, you'll want to put that variable as a CLASS variable instead or manually create your dummies.

 

Here's a very basic intro to PROC GLM but the SAS/STATS course is free online.

https://stats.idre.ucla.edu/sas/dae/multivariate-regression-analysis/

 


@KarimaTouati wrote:

Hello, 

I am beginner to deal with Proc GLM and I am trying to apply this model :

m3.PNG

with this SAS code : 

PROC SORT
	DATA=TAB2 (keep= Country Sex Age Group year EmployPop EUfshare ImmiShare bar_ent )
	OUT=Sorted_TAB2;
	BY group;  /*when using group returns the same result */
RUN;

TITLE "Model M3";
Proc GLM Data=Tab2;
model EmployPop=EUfshare bar_ent*ImmiShare/ solution CLPARM alpha=0.05;
By Group ; run;
quit;

I don't know if the above code give me taht kind of combinnation or I need to run two regressions ?

And How can I obtain the restricted and unrestricted RSS?

Thank you in advance.



 

KarimaTouati
Obsidian | Level 7

Thank you for your response @Reeza .

1- How does the varibale names  of my model don't align whith variable names in my code ? Can you explain more please ?

2- You are right in that. I forgot to change it.

3- I used "BY Group" because : i is demographic group (differing in age and sex), j is country and t is year.

So what should I use instead ? I thought that using Class is when we have categorical variables.

4- My code give me that kind of combinnation or I need to run two regressions ?

And How can I obtain the restricted and unrestricted RSS?

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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
  • 2 replies
  • 746 views
  • 0 likes
  • 2 in conversation