paired samples-equality of variance and 95% CI around difference

Hi,

Can a few of you please review the approach I plan to take for obvious errors?

I have 50 subjects and each have a measure taken on the same variable before and after treatment. So, this is standard paired t-test time, but what I am actually interested in is the variance of the treatment versus the control. I would like to test the equality of variance for these two groups of values (treatment and control) and also place a 95% confidence interval around the difference of these two variances. I would prefer randomization/resampling methods to be used for each as normality assumptions do not hold and I would like a robust result. I have not found any routines specifically like what I would want, so I think I may have to do the following in R. Any advice on an easier or better approach is welcome.

I know that equality of variance for paired data can be tested using the pitman-morgan statistic. I was planning on calculating this for the original data and then randomly switching the values within pairs the the pre-treatment and post-treatment measures in order to achieve randomization that respects the paired nature of the data. I could then extract p-values based upon the percent of randomizations with more extreme pitman-morgan statistic.

For the 95% CI interval around the differences, I thought I would resample pairs of values with replacement. So, I would select among the 50 subjects 50 times with replacement. I would then calculate the variance for the pre-treatment measures and for the post-treatment measures and I would then take the difference and store this value. I would do this many times and then determine the 95% confidence interval by ordering my resamples and simply taking the 2.5% and 97.5% percentiles.

Re: paired samples-equality of variance and 95% CI around difference

The third paragraph looks nice to me. But bear in mind that since they are paired data, calculate the differences and construct a 95 ci for the mean difference.
Now if you want to see whether the two groups are diffrent I suggest you do something like repeated measures anova. it is let's say a paired t-test that will also see if the two groups are significantly different or not. There is definetely a routine in R for this, but I haven't used it. I use SPSS for this usually.
What you sauid in the second paragraph. Why do you need a pitman-morgan test? for two dependent samples?

Re: paired samples-equality of variance and 95% CI around difference

Thanks for the reply. I was wanting a confidence interval around the differences in variances between control/treatment. That's why I mentioned resampling and taking the variance of control and treatment from each resample and then taking the difference in these two variances for each iteration. What you wrote was encouraging but left me a bit confused, so maybe I didn't express myself well. It would be like this for one resample (using 3 subjects for ease of illustration).

subject control treatment
1 10 15
2 15 20
3 7 9

A sample with replacement might be subject 1, subject 2, and subject 2 (again).

The variance for the control would be the variance of (10, 15, 15) = X and that of the treatment would be variance of (15,20, 20) = Y. I would then subtract X from Y (Y-X) and store this value. If I did this 1,000 times, let's say I would have a mean difference in variances as well as 95% CI using percentile method or another. Make sense?

As far as the Pitman-Morgan statistics, it is a test of equality of variance for paired data. Other's like Levene's and Bartlett's test are tests of equality for independent data (no pairs). There is a paper with a permutation test using the Pitman-Morgan stat, but it attempts to test the joint null hypothesis that there is no difference in mean or variance between the paired samples, so I would want to eliminate the difference in mean part as that is not of interest in my case.

Re: paired samples-equality of variance and 95% CI around difference

Thanks, as luck would have I was just reading about this. Yes, it seems more straightforward. Is this suggested because it is similar to an F-test? Because it holds more information?

Re: paired samples-equality of variance and 95% CI around difference

because it hoilds more inofrmation. The F-test uses the same test statistic, (not because it is similar to an F-test, this statement is not quite correct).

Re: paired samples-equality of variance and 95% CI around difference

I have to confess that I can't really see how the ratio of variances is in general a better choice than the difference of variances for this application. I was curious exactly how one would implement this type of bootstrapping in R anyway, so I worked it out on some simulated data and compared the results of var(A)-var(B) to var(A)/var(B). Code and results are below.

I'm going to cross-post a version of this code in the code sticky from the R/Splus forum shortly, along with some geeky details about the implementation and a discussion of how to get it to play even nicer with the boot() function, if anyone is interested in that. But you should be able to adapt this code with minimal modification to work on your data as is, seth.

The bootstrapped p-value for the variance difference is .086, while the bootstrapped p-value for the variance ratio is .016, despite that they used the exact same resamples. Since I simulated the data such that the variance for post "truly is" greater than the variance for pre, we might say that if alpha=.05 then the result from the variance difference is a type II error while the result from the variance ratio is not. Testing relative power and type 1 error rates for these using many simulated data sets would be interesting and wouldn't involve much more work at all if anyone is interested.

But again, I confess that I don't have an intuitive grasp on why these two statistics differ practically in terms of the results they get. My prediction was that the two results from above would be identical. I would appreciate some insight on this. Even the apparently obvious fact that the variance ratio "holds more information" than the variance difference is not at all obvious to me...

Re: paired samples-equality of variance and 95% CI around difference

Opa wait, you said you wanted to calculate confidence intervals, not perform hypothesis testing. Furthermore, the absolute difference of the variances could be something, not just the differences. Is the differecne a pivotal statistic? no, the ratio is. But anyway, did you do resampling under the null hypothesis? I think not.

Re: paired samples-equality of variance and 95% CI around difference

Ok, let's say that you have a point. You said before

"The bootstrapped p-value for the variance difference is .086, while the bootstrapped p-value for the variance ratio is .016, despite that they used the exact same resamples. " the results agree, there is not difference in the variances based upon the confidence intervals of either way.

Re: paired samples-equality of variance and 95% CI around difference

How do you figure that they agree? The results based on the variance difference would lead us to believe that our observed results are over 5x more likely under the null hypothesis than the results based on the variance ratio.