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

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:

Analysis Variable : UOSMOLVN Osmolality(mOsm/kg) Numerical ValueLot AEOccurrence(Yes/No) N Obs Lower 95%CL for Mean Upper 95%CL for MeanN 116Y 18
344.1497139350.8675275
328.3620766344.0823679


Code 2 :
proc glm data=KK;
class lotresp;
model UOSMOLVN=lotresp;
means lotresp/clm t ;
quit;

                                                       output 2 : 

lotresp N Mean 95% Confidence LimitsNY
116347.509344.209350.808
18336.222327.846344.599

 

Both codes generate the same means, but why CI are different?

 

 

Thanks in advance.

H

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

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.

--
Paige Miller

View solution in original post

2 REPLIES 2
Reeza
Super User

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. 

PaigeMiller
Diamond | Level 26

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.

--
Paige Miller

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 2 replies
  • 994 views
  • 4 likes
  • 3 in conversation