BookmarkSubscribeRSS Feed
ciro
Quartz | Level 8

Hello,

I would like to merge the estimated coefficients of a regression with the mean of the corresponding independent variables.

I perform the regression with proc genmod and take the parameters from the parameterestimates table through ods output.

this table has one column for the variable name( called parameter), one column for the level of the variable (called level1) and one column for the estimate (estimate). The column level1 report the (possibly formatted) value of a classification variable while it is empty for a non class variable.

I imagine I can obtain the means of the classification variable through proc means and then collapse the column of the levels of the variables into one and then append to this dataset the means of the non classification variables but I was wondering if there is any simpler solution. Since I would like to generalize the program I would appreciate hints in either ways.

Thank you in advance

I

5 REPLIES 5
ciro
Quartz | Level 8

Just a clarification: for mean of a level of the classification variable I intend the mean of the implicit dummy that is the share of cases with that specific level  (I am using param=ref).

Rick_SAS
SAS Super FREQ

I'm not 100% sure of your intention, but it sounds like you want to use the OUTDESIGN= option to output the design matrix, and feed that to PROC MEANS. The difficulty, I suppose, is that GENMOD doesn't support OUTDESIGN= and you want PARAM=REF, so you can't use GLMMOD.  Try GLIMMIX or LOGISTIC, and read http://support.sas.com/kb/23/217.html

ciro
Quartz | Level 8

Dear Rick, thank you for your suggestion that made me know the outdesign option. However it seems that proc glimmix does not support reference values for classification variables and proc logistic is not appropriate since I am using a linear regression model (link=identity dist=normal in genmod).

Rick_SAS
SAS Super FREQ

Read the KB article I linked to. You aren't actually doing the analysis, you're just getting the design matrix. You can put anything for Y. It can be continuous, constant, whatever. All that matters is the right-hand side.  For example:

proc logistic data=sashelp.class outdesign=design outdesignonly;

class sex(param=ref);

model  height = age weight sex;

run;

proc print;run;

ciro
Quartz | Level 8

thanks again! I didn't undenrstand before before. It seems the right direction.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 5 replies
  • 1270 views
  • 4 likes
  • 2 in conversation