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

when I run heterogeneous variance model using proc glimmix to test homogeneity of variance assumption I get this

 

DATA a;
input id 1 batch 1 ref 5-7 new 9-11;
diff=new-ref;
datalines;
1 116 119
2 115 121
3 103 121
4 135 130
5 108 116
6 113 122
7 115 117
8 127 124
;
keep batch ref new diff;


*wide-format data to long-format data;
DATA b;
SET a;
ARRAY trials[2] ref new;
DO TIME = 1 TO 2;
y = trials[TIME];
trial = TIME-1;
OUTPUT; *wihtout this time=3 values overwrite all;
END;
KEEP batch y trial;
proc print data=c (OBS=12) NOOBS; run;

*run glm;
PROC GLIMMIX data=b plots=residualpanel;
CLASS trial (ref=first);
MODEL y=trial /solution ddfm=KR;
random _residual_ /group=trial type=VC;
covtest /wald;
LSMEANS trial /alpha=0.05 cl diff plot=diffplot;
run;

Covariance Parameter Estimates
Cov ParmGroupEstimate

Standard

Error

Z ValuePr > Z
Residual (VC)trial 119.357110.34681.870.0307
Residual (VC)trial 0103.4355.28491.870.0307

my question is: why z and p values for variance components are fixed to be equal to each other? is this some sort of model constraints? If the sample do not pass the homogeneity variance test so I end up keeping heterogenous variance in the model, can i use and interpret these p-values? Thanks!

 

Best,

Tom

1 ACCEPTED SOLUTION

Accepted Solutions
SteveDenham
Jade | Level 19

The fixed effect t values and p values certainly should be fine. I have some hesitation about the Wald chi-square and p values for the random effects with only 8 subjects, as these are asymptotically correct as the sample size approaches infinity, and while 8 is a large number for tests about fixed effects, it certainly is not for tests about variance components.

 

SteveDenham

View solution in original post

6 REPLIES 6
SteveDenham
Jade | Level 19

Hi @Tomchoi ,

 

I can't reproduce what you have, given your set-up code (The GLIMMIX part looks OK for now).  When I run everything down to the PROC PRINT, the dataset WORK.b is missing the y variable for all instances of Trial 0.  Could you double check what is going on?  Once we have values for Trial 0, then we can see what GLIMMIX is up to.

 

SteveDenham

Tomchoi
Fluorite | Level 6
sorry there was mistake with data procedure. pls use this code:

DATA a;
input batch 1 ref 3-5 new 6-9;
diff=new-ref;
datalines;
1 116 119
2 115 121
3 103 121
4 135 130
5 108 116
6 113 122
7 115 117
8 127 124
;
proc print data=a; run;
Tomchoi
Fluorite | Level 6
this is full code:

/*Entering data manually*/
DATA a;
input batch 1 ref 3-5 new 6-9;
diff=new-ref;
datalines;
1 116 119
2 115 121
3 103 121
4 135 130
5 108 116
6 113 122
7 115 117
8 127 124
;
proc print data=a; run;

*wide-format data to long-format data;
DATA b;
SET a;
ARRAY trials[2] ref new;
DO TIME = 1 TO 2;
y = trials[TIME];
trial = TIME-1;
OUTPUT; *wihtout this time=3 values overwrite all;
END;
KEEP batch y trial;
proc print data=b (OBS=12) NOOBS; run;

*run glm;
PROC GLIMMIX data=b plots=residualpanel;
CLASS trial (ref=first);
MODEL y=trial /solution ddfm=KR;
random _residual_ /group=trial type=VC;
covtest /wald;
LSMEANS trial /alpha=0.05 cl diff plot=diffplot;
run;
SteveDenham
Jade | Level 19

Thanks, @Tomchoi .

 

I have poked and prodded at this, and it seems that no matter how I reparameterize, the Wald tests come out the same.  All I can guess is that the denominators (asymptotic standard errors) are wholly dependent on the estimate, so that algebraically you get the same ratio, and thus the same Z value.

 

SteveDenham

Tomchoi
Fluorite | Level 6
Hi. Thanks for your honest answer 🙂 do you still think I can report & interpret the t values and p values?
SteveDenham
Jade | Level 19

The fixed effect t values and p values certainly should be fine. I have some hesitation about the Wald chi-square and p values for the random effects with only 8 subjects, as these are asymptotically correct as the sample size approaches infinity, and while 8 is a large number for tests about fixed effects, it certainly is not for tests about variance components.

 

SteveDenham

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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
  • 6 replies
  • 968 views
  • 2 likes
  • 2 in conversation