- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I am looking to create a table where I need to use the confidence intervals after selecting the method, I used GLMSELECT then GLM, but I am having the issue to run the GLM code because I am not sure how the macro variable created here . I see the post from @Rick_SAS . Hope can you help with my code , what is the macro variable I expect here.
ods output ParameterEstimates = estimates;
proc glm data=both;
class STRn STRLn trt L1 L2 L3 L4 L5 L6 L7 L8 L9 ;
model chg=base STRCVRn STRLABAn trt L1 L2 L3 L4 L5 L6 L7 L8 L9
trt*L1 trt*L2 trt*L3 trt*L4
trt*L5 trt*L6 trt*L7 trt*L8
trt*L9
/ selection= stepwise(select=SL /*sle=0.15 sls=0.2*/ ) stats=all ;
run;
/*%put &=?;*/ ( what is my macro variable will be?)
proc glm data=both;
class STRCVRn STRLABAn trt L1 L2 L3 L4 L5 L6 L7 L8 L9 ;;
model chg = /*?*/ / solution CLPARM; /* or CLB for PROC REG */
run;
ods trace off;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Sorry for the typo error, please consider the class statement is same in both procedures.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I'm a little confused by your request. Confidence intervals for what?
As far as I know, PROC GLMSELECT does not produce confidence intervals. PROC GLM does. Are you trying to use PROC GLMSELECT to determine the model and then PROC GLM to get confidence intervals?
What macro variable are you referring to? I don't see a need for macro variables here.
Paige Miller
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for your response. First part of your question is right! I am trying to to use PROC GLMSELECT to determine the model and then PROC GLM to get confidence intervals.
coming to macro variable, I was trying to follow the one of the post, I really don't have experience in these procedures. Here the link for the post
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I do not see where a macro variable is needed here. But I also don't know what you a referring to where you got the code that has a macro variable.
Paige Miller
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
ods output ParameterEstimates = estimates;
proc glm data=both;
class STRn STRLn trt L1 L2 L3 L4 L5 L6 L7 L8 L9 ;
model chg=base STRn STRLn trt L1 L2 L3 L4 L5 L6 L7 L8 L9
trt*L1 trt*L2 trt*L3 trt*L4
trt*L5 trt*L6 trt*L7 trt*L8
trt*L9
/ selection= stepwise(select=SL /*sle=0.15 sls=0.2*/ ) stats=all ;
run;
proc glm data=both;
class STRn STRLn trt L1 L2 L3 L4 L5 L6 L7 L8 L9;
model chg =/ / solution CLPARM; /* or CLB for PROC REG */
run;
ods trace off;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
First, do you want confidence intervals for the predicted values or for the CIs for the regression parameters (coefficients)? From your code, I am assuming you want CIs for the regression coefficients.
The method you want is described in the article "Which variables are in the final selected model?"
The first procedure call should be the PROC GLMSELECT, which will select the model and create the _GLSIND macro variable. You can then use the macro variable in PROC GLM to fit the selected model and get inferential statistics for that model.
In short, it looks like you just need to change the first procedure to GLMSELECT.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
"For the reduced model with stepwise selection, initially proc glmselect needs to run to assess significance of the terms in the model. Once the fixed effect terms that stay in the reduced model are determined, rerun the proc mixed to obtain the reduced model." I will try to post output too