turn on suggestions

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

Showing results for

Find a Community

- Home
- /
- Analytics
- /
- Stat Procs
- /
- Is there a way to test for equal variances in PROC...

Topic Options

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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

07-08-2014 11:14 AM

I am aware how to do that on GLM, however, if I have random variables in my mixed model, not sure how one account for that on using GLM. So, is there a way to test / check for equal variances in Mixed? Or should one do in GLM without the random variables.

Thank you,

Marcio

Accepted Solutions

Solution

07-09-2014
11:26 AM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

07-09-2014 11:26 AM

There is a way in PROC GLIMMIX, and since about anything that can be done in MIXED can be done in GLIMMIX, I would recommend it.

As an example, suppose you wanted to test if the variances by group_no in the following were homogeneous:

proc glimmix data=somedata;

class group_no;

model response_var=group_no;

random _residual_/group=group_no;

covtest homogeneity;

run;

This will give a likelihood ratio test of the homogeneity of variances over the fixed effect of group_no. It is not restricted by sample size (as is Levene's test), and will accommodate more complex models as needed.

Steve Denham

All Replies

Solution

07-09-2014
11:26 AM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

07-09-2014 11:26 AM

There is a way in PROC GLIMMIX, and since about anything that can be done in MIXED can be done in GLIMMIX, I would recommend it.

As an example, suppose you wanted to test if the variances by group_no in the following were homogeneous:

proc glimmix data=somedata;

class group_no;

model response_var=group_no;

random _residual_/group=group_no;

covtest homogeneity;

run;

This will give a likelihood ratio test of the homogeneity of variances over the fixed effect of group_no. It is not restricted by sample size (as is Levene's test), and will accommodate more complex models as needed.

Steve Denham

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

07-09-2014 12:33 PM

Thank you, that is very helpful! Can I replace _residual_ for my block variable?

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

07-09-2014 12:37 PM

Not quite. You will need two random statements:

proc glimmix data=somedata;

class group_no block;

model response_var=group_no;

random _residual_/group=group_no;

random block; /*and perhaps block*group_no */

covtest homogeneity;

run;

Steve Denham

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

07-09-2014 12:39 PM

Perfect Steve. Thanks!

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

03-28-2016 05:29 PM

Hi Steve

I am having a similar issue on checking equlaity of varainces. My experiment involves repeated measurements on 30 subjects. 6 scans on human back, taken within 5 sec all in one sanp shot. So we have repeated data. I want to test for equality of varainces in gender , bmi and bf groups.

I am doing correct by running a model as below??

```
proc glimmix data=dat;
class gender bmi pt bf ;
model distance=gender| bmi| bf;
random intercept/sub=pt type=un group=bf; * runing it 3 times for each gender, bmi and bf group to test for equality of varaince in the three subgroups;
covtest homogeneity;
run;
```

Thanks so smuch

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

03-30-2016 01:39 PM

That will work. Now the question comes, why are you testing for homogeneity? My feeling on this is that unless you need homogeneity in order to fit the model, say due to memory constraints, just fit the heterogeneous variance model--let the data determine things. The advantage of mixed models is that there is no assumption of homogeneity of variance required in the application of the optimizing algorithm.

Steve Denham

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

04-01-2016 02:26 PM

Well the reason for testing the homogeneity of varainces is we are just trying to understand the varaibility of a new medical device. The investigator wanted to see how much varaibility is there within repated scans done on gender , bmi and body fat groups. Although we can get pooled estimates of varainces for these groups but he also wanted to see if there is significant difference in the varainces of the three groups?

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

04-04-2016 08:06 AM

I see. Then your code will give likelihood ratio tests for the homogeneity of variance across groups for each of the grouping effects. I hope that is what you are looking for.

Steve Denham