09-25-2011 02:17 PM
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
09-25-2011 03:16 PM
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).
09-26-2011 02:10 PM
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
09-27-2011 06:35 AM
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).
09-27-2011 10:08 AM
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;
model height = age weight sex;