Programming the statistical procedures from SAS

means of independent variables and regression coefficients

Reply
Contributor
Posts: 43

means of independent variables and regression coefficients

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

Contributor
Posts: 43

means of independent variables and regression coefficients

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).

SAS Super FREQ
Posts: 3,547

means of independent variables and regression coefficients

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

Contributor
Posts: 43

means of independent variables and regression coefficients

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).

SAS Super FREQ
Posts: 3,547

means of independent variables and regression coefficients

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;

Contributor
Posts: 43

means of independent variables and regression coefficients

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

Ask a Question
Discussion stats
  • 5 replies
  • 147 views
  • 4 likes
  • 2 in conversation