BookmarkSubscribeRSS Feed
jessho
Calcite | Level 5

I ran a multivariable linear regression model in SAS and got parameter estimates; my model uses compensation as the dependent variable and gender amongst other demographic variables as the predictors. 

 

proc glm;

class race gender rank;

model = total_comp = age race gender rank / solution ss3;

run;

 

However, I was also hoping to be able to use this model to calculate the mean total compensation using the parameter (coefficient) estimates generated from the above model for men and for women (i.e.m when the independent variable gender=0 and when gender=1).  I am not sure how to program this though -- as I have only been able to see multiple predicted compared to actual values instead of a mean predicted total compensation for each gender category.

 

Please help -- happy to provide more information if helpful.

 

Thanks!

Jess

4 REPLIES 4
Reeza
Super User

That's not the code you ran, is it? If not, please post the code and log. You should always have a DATA= and you shouldn't have that first = in the MODEL statement so I wonder if your code ran correctly. 

 

I wonder if an effect plot wouldn't be more useful?

https://blogs.sas.com/content/iml/2016/06/22/sas-effectplot-statement.html

 

You can calculate an estimate, but you have to make assumptions regarding race gender and rank. You can assume the reference categories you set - or didn't in this case.  Or you could do it for all and then if you know the N's in your population weight them accordingly? Not sure about the statistical validity of that approach. 

 

 

 

 

 

 

PaigeMiller
Diamond | Level 26

@jessho wrote:

I ran a multivariable linear regression model in SAS and got parameter estimates; my model uses compensation as the dependent variable and gender amongst other demographic variables as the predictors. 


 

However, I was also hoping to be able to use this model to calculate the mean total compensation using the parameter (coefficient) estimates generated from the above model for men and for women (i.e.m when the independent variable gender=0 and when gender=1).  I am not sure how to program this though -- as I have only been able to see multiple predicted compared to actual values instead of a mean predicted total compensation for each gender category.



Certainly, you could use the LSMEANS statement to obtain the least-squares mean of total_comp for men and for women.

--
Paige Miller
jessho
Calcite | Level 5

Thanks, Paige. I tried that, but I could not get the LS Means by gender (nor could I get the 95% confidence intervals).  I coded:

 

proc glm data=x;

class race gender rank;

model total_comp = age race gender rank / solution;

lsmeans total_comp / cl;

run;

 

Any sense of what I am coding incorrectly if I want the LSMean for gender=0 and LSMean for gender=1?

 

Thanks!

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
  • 4 replies
  • 1526 views
  • 4 likes
  • 3 in conversation