Question
Hi there, the following questions wants me to use the R software to check my work that was done in question 7. All of that
Hi there,
the following questions wants me to use the R software to check my work that was done in question 7. All of that work is below!
The question I need help on is: Use R's built-in test command to confirm your results in the previous exercise, number 7. Ifappropriate conduct and interpret Tukey's HSD test, which can be checked in R using the TukeyHSD() command. You can type directly into your R script file (using comments) or upload to Canvas a pdf showing your handwritten work and interpretation. NOTE: You should have two vector objects-one for number of probation violations (dependent variable) and one for caseload supervision size (independent variable), which you need to enter as a factor (as shown below) and enclose in quotes when running the TukeyHSD() command:
css <- as.factor(c(1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3))
Work from question 7:
Let,
1 = Average number of probation breaches or new offences under the probation officer with 'low' caseloads.
2 = Average number of probation breaches or new offences under the probation officer with 'moderate' caseloads.
3 = Average number of probation breaches or new offences under the probation officer with 'heavy' caseloads.
The hypotheses are,
H0: 1 = 2 = 3
H1: At least one of the means is not equal.
We are going to perform a one-way ANOVA to test the hypothesis at level of significance = 0.01.
The table of calculations is provided below.
No. | Low (1) | Moderate (2) | Heavy (3) |
1 | 7 | 10 | 11 |
2 | 8 | 14 | 12 |
3 | 7 | 8 | 13 |
4 | 5 | 7 | 10 |
5 | 8 | 9 | 9 |
6 | 11 | 11 | 12 |
7 | 10 | 7 | 13 |
8 | 8 | 12 | 14 |
9 | 8 | 8 | 10 |
10 | 6 | 8 | 9 |
SUM | 78 | 94 | 113 |
Group Means
x1 = 78 / 10 = 7.8
x2 = 94 / 10 = 9.4
x3 = 113 / 10 = 11.3
Combined Mean
x = (78 + 94 + 113) / 30 = 9.5
Treatment Sum of Squares (SSB) [or Between Groups]
SSB
= n(xj - x)2
= 10(7.8 - 9.5)2 + 10(9.4 - 9.5)2 + 10(9.5 - 11.3)2
= 61.4
Residual Sum of Squares (SSE) [or Within Groups]
SSE(Low) = (7 - 7.8)2 + (8 - 7.8)2 + (7 - 7.8)2 + (5 - 7.8)2 + (8 - 7.8)2 + (11 - 7.8)2 + (10 - 7.8)2 + (8 - 7.8)2 + (8 - 7.8)2 + (6 - 7.8)2 = 27.6
SSE(Moderate) = (10 - 9.4)2 + (14 - 9.4)2 + (8 - 9.4)2 + (7 - 9.4)2 + (9 - 9.4)2 + (11 - 9.4)2 + (7 - 9.4)2 + (12 - 9.4)2 + (8 - 9.4)2 + (8 - 9.4)2 = 48.4
SSE(Heavy) = (11 - 11.3)2 + (12 - 11.3)2 + (13 - 11.3)2 + (10 - 11.3)2 + (9 - 11.3)2 + (12 - 11.3)2 + (13 - 11.3)2 + (14 - 11.3)2 + (10 - 11.3)2 + (9 - 11.3)2 = 28.1
SSE
= (xij - xj)2
= SSE(Low) + SSE(Moderate) + SSE(Heavy)
= 27.6 + 48.4 + 28.1
= 104.1
Total Sum of Squares (SST)
SST = SSB + SSE
SST = 61.4 + 104.1
SST = 165.5
Mean Square Between (MSB)
MSB = SSB / (k-1)
[k = No. of Treatments]
MSB = 61.4 / (3-1)
MSB = 30.7
Mean Square Error (MSE)
MSE = SSE / (n-k)
[k = No. of Treatments]
MSE = 104.1 / (30-3)
MSE = 3.8556
Test Statistic (F)
F = MSB / MSE
F = 30.7 / 3.8556
F = 7.9625
Critical Value (FCritical)
FCritical
= F(;k-1,n-k)
= F0.01;2,27
= 5.4881
[(Using Excel function "=F.INV.RT(0.01,2,27)"]
The completed ANOVA table is given below.
Source of Variation | SS | DF | MS | F | FCritical |
Between Groups | 61.4 | 2 | 30.7 | 7.9625 | 5.4881 |
Within Groups | 104.1 | 27 | 3.8556 | ||
Total | 165.5 | 29 |
Interpretation: We reject the null hypothesis since F > FCritical. Therefore, we can say that at 1% level of significance that there is a difference in the average number of probation breaches or new offences between the three groups.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started