Title: | Bootstrap Tests for Equality of 2, 3, or 4 Population Variances |
---|---|
Description: | Tests the hypothesis that variances are homogeneous or not using bootstrap. The procedure uses a variance-based statistic, and is derived from a normal-theory test. The test equivalently expressed the hypothesis as a function of the log contrasts of the population variances. A box-type acceptance region is constructed to test the hypothesis. See Cahoy (2010) <doi:10.1016/j.csda.2010.04.012>. |
Authors: | Dexter Cahoy |
Maintainer: | Dexter Cahoy <[email protected]> |
License: | GPL (>= 3) |
Version: | 0.1.3 |
Built: | 2024-10-25 05:47:12 UTC |
Source: | https://github.com/dcahoy/testequavar |
Testing equality of two (2) population variances against the alternative that both variances are not equal.
equa2vartest(x1, x2, a, B)
equa2vartest(x1, x2, a, B)
x1 |
first sample vector of data or observations |
x2 |
second sample vector of data or observations |
a |
significance level alpha |
B |
number of bootstrap samples. At least 500 is recommended. |
list consisting of a non-numeric decision whether to reject the null hypothesis or not, the significance level, the number of bootstrap samples used, and the bootstrap P-value calculated using the Euclidean distance.
Cahoy, DO (2010), A Bootstrap Test For Equality Of Variances, Computational Statistics & Data Analysis, 54(10), 2306-2316. <doi:10.1016/j.csda.2010.04.012>
x1=sqrt(10)*runif(8, -sqrt(3), sqrt(3) ) x2=sqrt(1)*runif(8, -sqrt(3), sqrt(3) ) equa2vartest(x1,x2,0.05, 1000) x1=sqrt(1)*rexp(8) x2=sqrt(1)*rexp(8) equa2vartest(x1,x2,0.01, 1000)
x1=sqrt(10)*runif(8, -sqrt(3), sqrt(3) ) x2=sqrt(1)*runif(8, -sqrt(3), sqrt(3) ) equa2vartest(x1,x2,0.05, 1000) x1=sqrt(1)*rexp(8) x2=sqrt(1)*rexp(8) equa2vartest(x1,x2,0.01, 1000)
Testing equality of three (3) population variances against the alternative that all variances are unequal.
equa3vartest(x1, x2, x3, a, B)
equa3vartest(x1, x2, x3, a, B)
x1 |
first sample vector of data or observations |
x2 |
second sample vector of data or observations |
x3 |
third sample vector of data or observations |
a |
significance level alpha |
B |
number of bootstrap samples. At least 500 is recommended. |
list consisting of a non-numeric decision whether to reject the null hypothesis or not, the significance level, the number of bootstrap samples used, and the bootstrap P-value calculated using the Euclidean distance.
Cahoy, DO (2010), A Bootstrap Test For Equality Of Variances, Computational Statistics & Data Analysis, 54(10), 2306-2316. <doi:10.1016/j.csda.2010.04.012>
x1=sqrt(10)*runif(10, -sqrt(3), sqrt(3) ) x2=sqrt(1)*runif(10, -sqrt(3), sqrt(3) ) x3=sqrt(1)*runif(10, -sqrt(3), sqrt(3) ) equa3vartest(x1,x2,x3, a=0.05, B=1000) equa3vartest( rexp(10) ,rexp(10) ,rexp(10) , a=0.01, B=1000)
x1=sqrt(10)*runif(10, -sqrt(3), sqrt(3) ) x2=sqrt(1)*runif(10, -sqrt(3), sqrt(3) ) x3=sqrt(1)*runif(10, -sqrt(3), sqrt(3) ) equa3vartest(x1,x2,x3, a=0.05, B=1000) equa3vartest( rexp(10) ,rexp(10) ,rexp(10) , a=0.01, B=1000)
Testing equality of four (4) population variances against the alternative that all variances are not equal.
equa4vartest(x1, x2, x3, x4, a, B)
equa4vartest(x1, x2, x3, x4, a, B)
x1 |
first sample vector of data or observations |
x2 |
second sample vector of data or observations |
x3 |
third sample vector of data or observations |
x4 |
fourth sample vector of data or observations |
a |
significance level alpha |
B |
number of bootstrap samples. At least 500 is recommended. |
list consisting of a non-numeric decision whether to reject the null hypothesis or not, the significance level, the number of bootstrap samples used, and the bootstrap P-value calculated using the Euclidean distance.
Cahoy, DO (2010), A Bootstrap Test For Equality Of Variances, Computational Statistics & Data Analysis, 54(10), 2306-2316. <doi:10.1016/j.csda.2010.04.012>
x1=sqrt(10)*runif(10, -sqrt(3), sqrt(3) ) x2=sqrt(1)*runif(10, -sqrt(3), sqrt(3) ) x3=sqrt(1)*runif(10, -sqrt(3), sqrt(3) ) x4=sqrt(1)*runif(10, -sqrt(3), sqrt(3) ) equa4vartest(x1,x2,x3, x4, a=0.05, B=500) equa4vartest(rexp(10) ,rexp(10) ,rexp(10) , rexp(10), a=0.01, B=1000)
x1=sqrt(10)*runif(10, -sqrt(3), sqrt(3) ) x2=sqrt(1)*runif(10, -sqrt(3), sqrt(3) ) x3=sqrt(1)*runif(10, -sqrt(3), sqrt(3) ) x4=sqrt(1)*runif(10, -sqrt(3), sqrt(3) ) equa4vartest(x1,x2,x3, x4, a=0.05, B=500) equa4vartest(rexp(10) ,rexp(10) ,rexp(10) , rexp(10), a=0.01, B=1000)
Tests the hypothesis that 2, 3, or 4 population variances are homogeneous or not using bootstrap.
Reference:
Cahoy (2010) <doi:10.1016/j.csda.2010.04.012>
Dexter Cahoy [email protected]