Squared Ranks For Variance
Squared Ranks For Variance
Introduction: In most of the testing situations, several populations are compared on the basis of location
parameters such as mean and median but there could be certain situations where the primary objective is
to compare the variance/dispersion instead of the location.
Conover (1981) developed the non-parametric alternative of the Leven’s test to test the equality of
dispersion parameters.
Data: To use squared ranks test for variances, the data consist of two random samples, let 𝑋1 , 𝑋2 , , , , , 𝑋𝑛
denotes the random sample of size n from population 1 and let 𝑌1 , 𝑌2 , , , , 𝑌𝑛 denote the random sample of
size m from population 2. Convert each 𝑋𝑖 and 𝑌𝑗 to its absolute deviation from the mean using 𝑈𝑖 =
|𝑋𝑖 − 𝜇| 𝑖 = 1,2, , , , 𝑛 and 𝑉𝑗 = |𝑌𝑗 − 𝜇| 𝑖 = 1,2, , , , , 𝑚 where 𝜇1 & 𝜇2 are the means for populations 1
and 2. if 𝜇1 & 𝜇2 are unknown then use the estimators 𝑋̅ & 𝑌̅ to follow the test.
Procedure:
Step 1:
For a two -tailed test
𝐻𝑜 : X and Y are identically distributed except for possibly different means.
𝐻1 : 𝑉𝑎𝑟(𝑋) ≠ 𝑉𝑎𝑟(𝑌)
For a one-tailed (lower type) test.
𝐻𝑜 : X and Y are identically distributed except for possibly different means.
If U and V do not have tied observations then the following sum can be used as the test statistics.
𝑛
𝑇 = ∑[𝑅(𝑈𝑖 )]2
𝑖=1
If the ties are present, Subtract the mean from T and divided this deviation with the standard deviation.
𝑇 − 𝑛𝑅̅2
𝑇1 =
𝑛𝑚 𝑛𝑚 ̅̅̅ 2 2 1/2
[ ∑𝑛𝑖=1 𝑅𝑖 4 −
𝑁(𝑁 − 1) (𝑁 − 1) (𝑅 ) ]
𝑛 𝑚
1 2
̅2
𝑅 = {∑[𝑅(𝑈𝑖 )]2 + ∑[𝑅(𝑉𝑗 )] }
𝑁
𝑖=1 𝑗=1
Where N=n+m,𝑅̅ 2 represents the average of the squared ranks of the combined samples and ∑𝑛𝑖=1 𝑅𝑖 4
represent the sum of the ranks raised 4th power
𝑁 𝑛 𝑚
4 4 4
∑ 𝑅𝑖 = ∑[𝑅(𝑈𝑖 )] + ∑[𝑅(𝑉𝑗 )]
𝑖=1 𝑖=1 𝑗=1
Step 4:
Calculation
Step 5:
Critical region: Quantiles of the squared ranks test will be used to test the null hypothesis provided that n
and m both are less than or equal to 10.
For a two-tailed test, reject 𝐻𝑜 if T is greater than its (1 − 𝛼⁄2) quantiles or less than its 𝛼⁄2
quantities.
For a lower-tailed test, reject 𝐻𝑜 if T is less than its 𝛼 quantilie.
For an upper-tailed test, reject 𝐻𝑜 if T is greater than its 1 − 𝛼 quantilies
Example 1:
A food packing company would like to be reasonable sure that the boxes of cereal it produces do in fact
contain at least the number of ounces of cereal stamped on the outside of the box. In order to do this it
must set average amount per box a little above the advertised amount, become an avoidable variation
caused by the packing machine will sometimes put a little less or a little more cereal in the box. A
machine with smaller variation would save the company money because the average amount per box
could be adjusted to be closer to the advertised amount. A new machine is being tested to see if it is less
variable than the present machine in which case it will be purchased to replace the old machine. Test the
hypothesis that both machines have equal variability.
Present 10.8 11.1 10.4 10.1 11.3
Machine(X)
Step 3:
Test Statistics :
𝑇 − 𝑛𝑅̅2
𝑇1 =
𝑛𝑚 𝑛𝑚 ̅̅̅ 2 2 1/2
[ ∑𝑛𝑖=1 𝑅𝑖 4 −
𝑁(𝑁 − 1) (𝑁 − 1) (𝑅 ) ]
462 − 5(54)
𝑇1 = 1/2
(5)(7) (5)(7) 2]
[ (60,660) − (54)
(12)(11) (11)
𝑇1 = 2.327
Step 4:
Computation:
X Y 𝑈𝑖 = |𝑋𝑖 − 𝜇| 𝑉𝑗 = |𝑌𝑗 − 𝜇| Ranks (𝑈𝑖 ) Ranks(𝑉𝑗 ) Squared Squared
ranks (𝑈𝑖 ) ranks(𝑉𝑗 )
10.7 0.09 5 25
𝑋̅ 𝑌̅ 𝑇 = 462 ∑ 186
= 10.74 = 10.79
𝑁 = 𝑛 + 𝑚 = 5 + 7 = 12
𝑛
𝑛 𝑚
1 2
𝑅̅ 2 = {∑[𝑅(𝑈𝑖 )]2 + ∑[𝑅(𝑉𝑗 )] }
𝑁
𝑖=1 𝑗=1
1
𝑅̅ 2 = {462 + 186}
12
𝑅̅ 2 = 54
𝑁 𝑛 𝑚
4 4 4
∑ 𝑅𝑖 = ∑[𝑅(𝑈𝑖 )] + ∑[𝑅(𝑉𝑗 )]
𝑖=1 𝑖=1 𝑗=1
∑ 𝑅𝑖 4 = (16)2 + (100)2 + (81)2 + (144)2 + (121)2 + (4)2 + (64)2 + (49)2 + (36)2 + (4)2
𝑖=1
+ (25)2 + (4)2
𝑁
∑ 𝑅𝑖 4 = 60,660
𝑖=1
𝑇 − 𝑛𝑅̅2
𝑇1 =
𝑛𝑚 𝑛𝑚 ̅̅̅ 2 2 1/2
[ ∑𝑛𝑖=1 𝑅𝑖 4 − ]
𝑁(𝑁 − 1) (𝑁 − 1) (𝑅 )
462 − 5(54)
𝑇1 = 1/2
(5)(7) (5)(7) 2]
[ (60,660) − (54)
(12)(11) (11)
𝑇1 = 2.327
Step 4:
Critical Region:
𝑇1 > 𝑧1−𝛼
2.327 > 1.96
Step 5:
Conclusion: AS𝑇1 lies in the Critical region therefore, we reject 𝐻𝑜 and conclude that the variability of
new machine is less than present machine.
Large-Sample Approximation:
For Sample sizes larger than 10 the following large-sample approximation.
Test Statistics:
𝑛(𝑁 + 1)(2𝑁 + 1)
𝐸(𝑇1 ) =
6
𝑚𝑛(𝑁 + 1)(2𝑁 + 1)(8𝑁 + 11)
𝑉𝑎𝑟(𝑇1 ) =
180
𝑛(𝑁 + 1)(2𝑁 + 1)
𝑇−
𝑇1 = 6
√𝑚𝑛(𝑁 + 1)(2𝑁 + 1)(8𝑁 + 11)
180
Example 2:
The blood banks record the rates of heartbeat of males and females required by several donors . Test the
hypothesis at 5% level of significance that both populations have equal variability.
Heartbeat 50 76 82 83 58 79 65 68 77 71 80
of Male
(X)
Heartbeat 69 74 75 76 73 72 75 64 67 62 54
of
Female(Y)
Solution:
Step 1:
𝐻𝑜 = 𝑉𝑎𝑟(𝑋) = 𝑉𝑎𝑟(𝑌)
𝐻1 = 𝑉𝑎𝑟(𝑋) ≠ 𝑉𝑎𝑟(𝑌)
Step 2:
Level of Significance =𝛼 = 0.05
Step 3: Test statistics
𝑛(𝑁 + 1)(2𝑁 + 1)
𝐸(𝑇1 ) =
6
𝑉𝑎𝑟(𝑇1 ) = √(𝑚𝑛(𝑁 + 1)(2𝑁 + 1)(8𝑁 + 11))/180
𝑛(𝑁 + 1)(2𝑁 + 1)
𝑇− 6
𝑇1 =
√𝑚𝑛(𝑁 + 1)(2𝑁 + 1)(8𝑁 + 11)
180
2461 − 1897.5
𝑇1 =
360.70
𝑇1 = 1.56224
Step 4: Computation:
X Y 𝑈 𝑉 Ranks Ranks Squared Squared
= (𝑋 − ̅̅̅
𝑋)2 = (𝑌 − ̅̅̅
𝑌)2 U V ranks (U) ranks(V)
50 69 471 0.04 22 1 484 1
76 74 18.5 23 7 8 49 64
82 75 106 33.6 18 12 324 132.25
83 76 128 46.2 19 14 361 196
58 73 188 14.4 20 6 400 36
79 72 53.3 7.84 16 4 256 16
65 75 44.9 33.6 13 11 169 132.25
68 64 13.7 27 5 9 25 81
77 67 28.1 4.84 10 3 100 9
71 62 0.49 51.8 2 15 4 225
80 54 68.9 231 17 21 289 441
𝑋̅ =71.7 𝑌̅ = 69.2 𝑇 = 2461 ∑ 13333.5
𝑛(𝑁 + 1)(2𝑁 + 1)
𝐸(𝑇1 ) =
6
11(22 + 1)(2(22) + 1)
𝐸(𝑇1 ) = = 1897.5
6
𝑉𝑎𝑟(𝑇1 ) = √(𝑚𝑛(𝑁 + 1)(2𝑁 + 1)(8𝑁 + 11))/180
𝑉𝑎𝑟(𝑇1 ) =360.70
𝑛(𝑁 + 1)(2𝑁 + 1)
𝑇− 6
𝑇1 =
√𝑚𝑛(𝑁 + 1)(2𝑁 + 1)(8𝑁 + 11)
180
2461 − 1897.5
𝑇1 =
360.70
𝑇1 = 1.56224
Step 5: Critical Region
|𝑇1 | > 𝑧 1 − 𝛼⁄2