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
- /
- Variance Testing Problem

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

10-17-2010 10:25 AM

HI

Whick PROC step can I use to directly verify the variance of a sample is equal or not equal to a specify value?(I just don't want to build the statistics by myself).Thanks for your answer.

Whick PROC step can I use to directly verify the variance of a sample is equal or not equal to a specify value?(I just don't want to build the statistics by myself).Thanks for your answer.

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

10-18-2010 10:01 AM

> HI

> Whick PROC step can I use to directly verify the

> variance of a sample is equal or not equal to a

> specify value?(I just don't want to build the

> statistics by myself).Thanks for your answer.

I think you have to create the test statistic yourself, using the computed variance, the hypothesized value, and the F-distribution.

> Whick PROC step can I use to directly verify the

> variance of a sample is equal or not equal to a

> specify value?(I just don't want to build the

> statistics by myself).Thanks for your answer.

I think you have to create the test statistic yourself, using the computed variance, the hypothesized value, and the F-distribution.

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

10-19-2010 08:47 AM

HI

Thanks!

I just want to know if there is a PROC step to solve it.

Thanks!

I just want to know if there is a PROC step to solve it.

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

10-19-2010 10:28 AM

This test is available using the COVTEST statement in the GLIMMIX procedure. I know this approach works for Version 9.2 (TS2M3); I don't know about earlier versions or previous maintenance releases.

HTH,

Susan

HTH,

Susan

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

10-20-2010 08:52 PM

In addition to the COVTEST statement of the GLIMMIX procedure (which does not seem to function when the only variance parameter is a residual variance), the UNIVARIATE procedure will construct 1-tailed and 2-tailed confidence limits for the variance of a response which is assumed to be normally distributed. That does not directly test a null hypothesis about the variance being a specified value. However, if you construct an alpha=0.05 CI and the CI includes the value under the null hypothesis, then you would not reject the null hypothesis at alpha=0.05.

If your null hypothesis has a two-tailed alternative (and you can assume that the response is normally distributed), then you can download from SAS a macro which will compute the p-value for the specified null. See http://support.sas.com/kb/25/024.html. The macro will not test a null hypothesis with a 1-sided alternative.

If your null hypothesis has a two-tailed alternative (and you can assume that the response is normally distributed), then you can download from SAS a macro which will compute the p-value for the specified null. See http://support.sas.com/kb/25/024.html. The macro will not test a null hypothesis with a 1-sided alternative.

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

10-20-2010 11:25 PM

The COVTEST option seems to work if the residual (which is the scale parameter) is not profiled:

data sample;

do id=1 to 30;

y=rannor(0);

output;

end;

run;

proc glimmix data=sample noprofile;

model y= ;

random _residual_ / subject=id;

/* Test whether sample variance = 1 */

covtest 1 / cl(type=elr);

/* Test whether sample variance = 2 */

covtest 2;

run;

The COVTEST option appears to be quite useful, but I haven't spent much time studying the documentation yet. Robin High has posted some nice examples on SAS-L recently.

Susan

data sample;

do id=1 to 30;

y=rannor(0);

output;

end;

run;

proc glimmix data=sample noprofile;

model y= ;

random _residual_ / subject=id;

/* Test whether sample variance = 1 */

covtest 1 / cl(type=elr);

/* Test whether sample variance = 2 */

covtest 2;

run;

The COVTEST option appears to be quite useful, but I haven't spent much time studying the documentation yet. Robin High has posted some nice examples on SAS-L recently.

Susan

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

10-21-2010 12:54 AM

Susan,

Thanks for posting the example. I had tried using the NOPROFILE option previously without success. What I did not have is the RANDOM statement specifying the residual with a unique subject specification. It is nice to know that it is possible to obtain a test of the residual variance using the COVTEST statement. However, it is not the most convenient syntax.

Thanks for posting the example. I had tried using the NOPROFILE option previously without success. What I did not have is the RANDOM statement specifying the residual with a unique subject specification. It is nice to know that it is possible to obtain a test of the residual variance using the COVTEST statement. However, it is not the most convenient syntax.

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

10-21-2010 10:35 AM

Dale,

It is rather convoluted, isn't it?! The more I learn about GLIMMIX the more I know I don't know.

I'm pleased you found it useful. I certainly have benefited from your postings on SAS-L.

Susan

It is rather convoluted, isn't it?! The more I learn about GLIMMIX the more I know I don't know.

I'm pleased you found it useful. I certainly have benefited from your postings on SAS-L.

Susan

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

10-23-2010 07:19 AM

THX Susan DALE and Paige.I am going to try it.

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

11-19-2010 04:16 PM

One can use different methods to get confidence intervals for a variance in GLIMMIX. I prefer the Profile-Likelihood method (type=profile), but the elr method is fine also. A simpler approach is to use Wald-type confidence intervals, as shown below. This is the approach used by PROC TTEST to give the confidence interval for the standard deviation. That is, if you take the square-root of the point estimate of the variance and square-root of the limits of the confidence interval from PROC GLIMMIX (with the Wald method), one gets the standard deviation estimate (and the confidence limits) in TTEST. Of course, the TTEST approach only works for a single variance in a model, but GLIMMIX allows for any number of variance-covariance estimates.

data sample;

do id=1 to 30;

y=rannor(0);

output;

end;

run;

proc glimmix data=sample noprofile;

model y= ;

random _residual_ / subject=id;

*covtest / cl(type=elr);

*covtest / cl(type=profile);

covtest / cl(type=Wald);

run;

proc ttest data=sample;

var y;

run;

data sample;

do id=1 to 30;

y=rannor(0);

output;

end;

run;

proc glimmix data=sample noprofile;

model y= ;

random _residual_ / subject=id;

*covtest / cl(type=elr);

*covtest / cl(type=profile);

covtest / cl(type=Wald);

run;

proc ttest data=sample;

var y;

run;

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

11-19-2010 04:23 PM

...and to continue... you can, of course, use the confidence interval for the variance to test the H0.

One can also use PROC MIXED to get the WALD confidence interval for the variance. Using the previous generated, one uses:

proc mixed data=sample covtest cl noprofile;

model y= ;

run;

One can also use PROC MIXED to get the WALD confidence interval for the variance. Using the previous generated, one uses:

proc mixed data=sample covtest cl noprofile;

model y= ;

run;

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

11-20-2010 02:49 AM

Proc ttest will give you a test for equality of variances for two sample.

SD Message was edited by: sivaji

SD Message was edited by: sivaji