I would like to use an F-Test for Equality of Variances on a variable to compare two groups. Normally, this would be done with an sdtest
command in Stata or a var.test
command in R. However, the data come from a multi-stage, stratified random sample with disproportionate selection, and thus, need to be weighted.
Both Stata and R have packages geared at running analyses with complex sampling weights. In Stata it is done via the svyset
command and subsequent analyses are ran with the svy
prefix (e.g. svy: mean
). Likewise, it is done in R via the survey
package, which also subsequently conducts analyses with a svy
prefix (e.g. svymean
).
But, unless I have overlooked something, neither seem able to do an F-test for Equality of Variances (or a similar test) on weighted data. They both can do difference in means t-tests (R via svyttest
) and Stata via postestimation commands.
Is there a workaround for this? A different test, perhaps, or a manual override in which the weighted data are converted to appear unweighted? Or is it statistically dubious to test for the equality of variances between two groups using weighted data (given that weighting affects variances), and therefore the reason why such options do not exist in Stata or R? If that's the case, what should one do when he or she wants to compare the variances of two groups that were sampled disproportionately? Certainly running F-tests on unweighted data isn't a better option, and since many surveys feature disproportionate selection methods, there must be some viable solution other than simply saying "you can't do that", right?