In: Statistics and Probability
In order to reduce hostility levels, twelve students were randomly assigned to three different types of therapy. After completing a therapy, each student was given a test that recorded hostility level. A lower score indicates lower hostility and vice-versa.
| 
 Therapy  | 
||
| 
 1  | 
 2  | 
 3  | 
| 
 80  | 
 74  | 
 62  | 
| 
 92  | 
 81  | 
 71  | 
| 
 87  | 
 78  | 
 72  | 
| 
 85  | 
 77  | 
 62  | 
Calculate the sample variance (or standard deviation) for each
therapy.
For Hartley's test of homogenity
| 
 Ho: σ²1 = σ²2 =
σ²3  | 
calculate the test statistic F'.
For σ = 0.05, specify the critical region for Hartley's test of
homogeneity and make a decision about Ho.
Find the P-value and compare to σ = 0.05.
Sol:
Calcuations for variances
| Therapy1(X) | xbar | x-xbar | (x-xbar)^2 | 
| 80 | 86 | -6 | 36 | 
| 92 | 86 | 6 | 36 | 
| 87 | 86 | 1 | 1 | 
| 85 | 86 | -1 | 1 | 
| total | 74 | 
variance=s1^2=74/4-1=74/3=24.6667
| Therapy2(X) | xbar | x-xbar | (x-xbar)^2 | 
| 74 | 77.5 | -3.5 | 12.25 | 
| 81 | 77.5 | 3.5 | 12.25 | 
| 78 | 77.5 | 0.5 | 0.25 | 
| 77 | 77.5 | -0.5 | 0.25 | 
| total | 25 | 
variance=s2^2=25/4-1=25/3=8.3333
| Therapy3(X) | xbar | x-xbar | (x-xbar)^2 | 
| 62 | 66.75 | -4.75 | 22.5625 | 
| 71 | 66.75 | 4.25 | 18.0625 | 
| 72 | 66.75 | 5.25 | 27.5625 | 
| 62 | 66.75 | -4.75 | 22.5625 | 
| total | 90.75 | 
variance=s3^2=90.75/4-1=90.75/3=30.25
create a data frame DF in R
Load PMCMRplus package
and use hartleytest
Rcode:
DF=read.table(header = TRUE, text ="
Therapy   Hostility_score
1   80
1   92
1   87
1   85
2   74
2   81
2   78
2   77
3   62
3   71
3   72
3   62
"
  
)
DF
summary(DF)
library(PMCMRplus)
hartleyTest(Hostility_score ~ Therapy , data = DF)
output:

F=3.63
p=0.568
p>0.05
Do not reject Ho.
Accept Ho