Could anyone explain what's the difference when calculate the mean and CI of "class" variable in proc means and proc glm. For example I want to calculate CI for 2 levels Y and N, (Note: not the difference between Y and N) I have 2 codes give me 2 different CI
Code 1 :
Proc means data=KK clm alpha=0.05 ;
Var UOSMOLVN;
class lotresp;
Output out=textn n=n mean=mean lclm=lclm uclm=uclm std=std ;
run;
Output 1:
344.1497139 | 350.8675275 |
328.3620766 | 344.0823679 |
Code 2 :
proc glm data=KK;
class lotresp;
model UOSMOLVN=lotresp;
means lotresp/clm t ;
quit;
output 2 :
116 | 347.509 | 344.209 | 350.808 |
18 | 336.222 | 327.846 | 344.599 |
Both codes generate the same means, but why CI are different?
Thanks in advance.
H
PROC GLM uses the root mean square error from the fitted model to determine confidence intervals, which in other words is the pooled standard deviation across all the values of LOTRESP. PROC MEANS uses the actual standard deviation for each value of LOTRESP. PROC GLM and PROC MEANS do not do the same thing, they're not supposed to do the same thing.
Don’t have time to verify this, but check if GLM is using a pooled SE whereas Means would not be using a pooled SE.
PROC GLM uses the root mean square error from the fitted model to determine confidence intervals, which in other words is the pooled standard deviation across all the values of LOTRESP. PROC MEANS uses the actual standard deviation for each value of LOTRESP. PROC GLM and PROC MEANS do not do the same thing, they're not supposed to do the same thing.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.