Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Home
- /
- Analytics
- /
- Stat Procs
- /
- wald test in heterogenous variance model using proc glimmix

Options

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

🔒 This topic is **solved** and **locked**.
Need further help from the community? Please
sign in and ask a **new** question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Posted 08-31-2021 08:51 PM
(735 views)

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 Parm | Group | Estimate | Standard Error | Z Value | Pr > Z |

Residual (VC) | trial 1 | 19.3571 | 10.3468 | 1.87 | 0.0307 |

Residual (VC) | trial 0 | 103.43 | 55.2849 | 1.87 | 0.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

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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

6 REPLIES 6

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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;

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;

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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;

/*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;

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Hi. Thanks for your honest answer 🙂 do you still think I can report & interpret the t values and p values?

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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

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

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.