BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
ph6
Obsidian | Level 7 ph6
Obsidian | Level 7

I use proc glm to find the estimates for a categorical variable with 3 levels; rs1 : {1,2,3}

I have identified level 1 as the reference category. I would like to find the standard error for the reference category

so that I could form CIs for it as well.

I use the following code:

 

PROC GLM DATA=AllData PLOTS=NONE;
        CLASS rs1(ref = '1');
        MODEL nmr_acace = rs1  /CLPARM   SOLUTION E;
		estimate 'rs1 1' intercept 1 rs1 1 0 0 ;
    QUIT;

I get the following results:

 Estimate            standard error
rs1 0   0.007628342    0.00335261 
rs1 2  -0.000113952   0.00833655 
rs1 1   0.000                .

             Estimate        standard error
rs1 1   3.05314364      0.00183197 
 

I do not know how to interpret the estimate for rs1 = 1 being 3.053. I was hoping to have it as 0 and by the standard error find the confidence intervals for it. 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Rick_SAS
SAS Super FREQ

The reference category is merged into the estimate for the Intercept. For CLASS variables, you can estimate the effect of differences. For the GLM parameterization, you are measuring the difference between non-reference levels and the reference level.

View solution in original post

4 REPLIES 4
Rick_SAS
SAS Super FREQ

The reference category is merged into the estimate for the Intercept. For CLASS variables, you can estimate the effect of differences. For the GLM parameterization, you are measuring the difference between non-reference levels and the reference level.

jiltao
SAS Super FREQ

Like @Rick_SAS pointed out, the estimates in the Parameter Estimates table have interpretations that might not be what you think.

You did not capture the estimate for Intercept in the Parameter Estimates table, which is important. Please refer to the following usage note for more explanations --

https://support.sas.com/kb/38/384.html

 

Your ESTIMATE statement estimates the response for the first level, which is level 0. If you want to estimate the response for the reference level (which is also the estimate for Intercept in the Parameter Estimates table), you should use --

estimate 'rs1 1' intercept 1 rs1 0 0 1;

 

Hope this helps.

Jill

ph6
Obsidian | Level 7 ph6
Obsidian | Level 7
I am designing a macro which could calculate the group means and SEs for a linear regression with categorical exposures. Is there any other way to find the group estimates, as it is hard to adjust the estimate statement when we have different number of categories?
SteveDenham
Jade | Level 19

Look into the LSMEANS statement - that will give you means and SE's.  With on ODS OUTPUT statement, you can put those into a dataset.  No direct need for a macro.

 

SteveDenham

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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