Programming the statistical procedures from SAS

PROC GLM or PROC REG to get 95%CIs for independent variables

Accepted Solution Solved
Reply
Contributor
Posts: 59
Accepted Solution

PROC GLM or PROC REG to get 95%CIs for independent variables

Hi all,

I am working on a national database looking at continuous outcome and many independent predictors like age, race group, income category, insurance status, etc. So my predictors are a mix of  continuous and categorical variables. I need to check which of these variables are significant precitors and also get the 95% CIs for these predictors.

 

I used Proc GLM to test the association but I am finding difficulty in getting the 95% CIs for the independent predictors. I would appreciate if anyone can help me with this.

 

Also is there a way I can control the which category within a variables (eg. Race ) will be a reference category just like proc logistic?

ods rtf;
proc sort data = ulcer; by descending ulcernew descending agecat1 descending Racecat  descending INCCAT1 
descending INSURE descending MARRIED1 descending smoke1 descending backpain4 descending diabetes; run;
* Multiple linear regression;
proc glm data = ulcer order=data;
  class ulcernew agecat1 Racecat INCCAT1 INSURE MARRIED1 smoke1 backpain4 diabetes;
  model pcs36v2 mcs36v2 pf36 mh36 re36 rp36 sf36a vt36 
      = agecat1  Racecat INCCAT1 INSURE MARRIED1 smoke1 backpain4 diabetes ulcernew / solution ss3;
run;
quit;
ods rtf close;

 

Thanks,

Sat


Accepted Solutions
Solution
‎05-09-2016 02:54 PM
SAS Super FREQ
Posts: 3,839

Re: PROC GLM or PROC REG to get 95%CIs for independent variables

Posted in reply to smunigala

Yes. In the CLASS statement use the REF= option in parentheses to define the reference level:

 

class  Racecat(ref="white") MARRIED1(ref="yes") ...;

 

As for the confidence intervals, I assume that you want 95% CIs for the parameter estimates. Use the CLPARM option on the MODEL statement:

 

model pcs36v2 ... = agecat1  ... / solution ss3 CLPARM;

 

 

View solution in original post


All Replies
Solution
‎05-09-2016 02:54 PM
SAS Super FREQ
Posts: 3,839

Re: PROC GLM or PROC REG to get 95%CIs for independent variables

Posted in reply to smunigala

Yes. In the CLASS statement use the REF= option in parentheses to define the reference level:

 

class  Racecat(ref="white") MARRIED1(ref="yes") ...;

 

As for the confidence intervals, I assume that you want 95% CIs for the parameter estimates. Use the CLPARM option on the MODEL statement:

 

model pcs36v2 ... = agecat1  ... / solution ss3 CLPARM;

 

 

Contributor
Posts: 59

Re: PROC GLM or PROC REG to get 95%CIs for independent variables

Hi Rick,

Thanks for the reply. I am getting the 95% CIs for the parameters, but when I assign the ref=option, I think it is not working. Ref=option should be highlighted in blue right? It is not in my code. Do I have any error? I use SAS 9.4.

 

Thanks,

Sat

proc glm data = ulcer;
  class ulcernew agecat1 Racecat(ref="Black") INCCAT1 INSURE MARRIED1 (ref="1") smoke1 backpain4 diabetes;
  model pcs36v2 
      = agecat1  Racecat INCCAT1 INSURE MARRIED1 smoke1 backpain4 diabetes ulcernew / solution ss3 CLPARM;
run;
quit;

 

 

SAS Super FREQ
Posts: 3,839

Re: PROC GLM or PROC REG to get 95%CIs for independent variables

[ Edited ]
Posted in reply to smunigala

Don't worry about the color. It works. Run it and you'll see.

 

FYI, suboptions do not always get coloration in the text editor. For example the following uses the WHERE= data set option, which is a valid option but is not colored blue in my version of SAS Windowing Environment (DMS), although the WHERE= (and REF=) statements are colored blue in SAS Studio and in this Support Communities window:

 

proc glm data=sashelp.class(where=(weight<200));
class sex(ref="M");
model weight = height | sex / solution;
run;

 

Contributor
Posts: 59

Re: PROC GLM or PROC REG to get 95%CIs for independent variables

Thank you so much!

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 356 views
  • 2 likes
  • 2 in conversation