Employment
A employment survey provided data showing the typical annual salary for 97 different jobs.The data is in file JobSalary.csv. Test the difference in mean annual salary for 3 categories: Computers, Construction and Engg.
Loading the csv file
js <- read.csv("F:\\Statistics\\Testing of Hypothesis\\JobSalary.csv")
head(js)
Analysis of Variance Test
anl <- aov(js$Salary_000 ~ js$Category)
summary(anl)
Df Sum Sq Mean Sq F value Pr(>F)
js$Category 2 3840 1919.8 15.64 6.94e-05 ***
Residuals 21 2578 122.8
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Tukey’s Test
TukeyHSD(anl)
Tukey multiple comparisons of means
95% family-wise confidence level
Fit: aov(formula = js$Salary_000 ~ js$Category)
$`js$Category`
diff lwr upr p adj
Construction-Computer -24.375 -38.339381 -10.41062 0.0007019
Engineer-Computer 4.375 -9.589381 18.33938 0.7133080
Engineer-Construction 28.750 14.785619 42.71438 0.0001096