Obsidian | Level 7

## How to estimate standard error for the reference category in proc glm?

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
SAS Super FREQ

## Re: How to estimate standard error for the reference category in proc glm?

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.

4 REPLIES 4
SAS Super FREQ

## Re: How to estimate standard error for the reference category in proc glm?

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.

SAS Super FREQ

## Re: How to estimate standard error for the reference category in proc glm?

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

Obsidian | Level 7

## Re: How to estimate standard error for the reference category in proc glm?

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?

## Re: How to estimate standard error for the reference category in proc glm?

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

Discussion stats
• 4 replies
• 1012 views
• 5 likes
• 4 in conversation