Sociologists often conduct experiments to investigate the relationship between s
ID: 3371459 • Letter: S
Question
Sociologists often conduct experiments to investigate the relationship between socioeconomic status and college performance. Socioeconomic status is generally partitioned into three groups: lower class, middle class, and upper class. The grade point averages (GPAs) for random samples of seven college freshmen associated with each of the three socioeconomic classes were selected from a university’s files at the end of the academic year. The data is recorded in the “gpa” worksheet (See Below).
a) Construct an ANOVA table using R Coding. Is there evidence of differences among the mean freshmen GPAs for the three socioeconomic classes? Test using ?? = .01.
b) If appropriate, perform a multiple comparisons analysis to identify significant differences among the socioeconomic classes at ?? = .01
Class GPA Lower 2.87 Lower 2.16 Lower 3.14 Lower 2.51 Lower 1.8 Lower 3.01 Lower 2.16 Middle 3.23 Middle 3.45 Middle 2.78 Middle 3.77 Middle 2.97 Middle 3.53 Middle 3.01 Upper 2.25 Upper 3.13 Upper 2.54 Upper 2.44 Upper 3.27 Upper 2.81 Upper 1.36Explanation / Answer
a)
H0: There is no differences among the mean freshmen GPAs for the three socioeconomic classes.
Ha: There is differences among the mean freshmen GPAs for the three socioeconomic classes
Save the worksheet as a csv file with name as gpa.csv.
Load the csv file inro R dataframe. Make sure the directory in which you have saved the file is curren working directory in R studio. If not, make the set the current working directory by the command setwd as the directory which contains gpa.csv file.
gpa = read.csv("gpa.csv")
Convert the class variable to a categorical variable, with the below command.
gpa$Class = as.factor(gpa$Class)?
Run the anova with GPA as dependent variable and Class as predictor variable.
anova.mod = aov(GPA ~ Class, data = gpa)
Run the summary of anova with the below command. You will get the anova table as the output.
> summary(anova.mod)
Df Sum Sq Mean Sq F value Pr(>F)
Class 2 2.396867 1.1984333 4.57892 0.024683 *
Residuals 18 4.711114 0.2617286
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
As, p-value (0.024683) is less than the significance level of 0.01, we reject the null hypothesis and conclude that there is significant evidence of differences among the mean freshmen GPAs for the three socioeconomic classes.
b.
Run the TukeyHSD command to perform a multiple comparisons analysis using Tukey HSD test to identify significant differences among the socioeconomic classes. For significance level of 0.01, the confidence level is 0.99.
> TukeyHSD(anova.mod, conf.level = 0.99)
Tukey multiple comparisons of means
99% family-wise confidence level
Fit: aov(formula = GPA ~ Class, data = gpa)
$Class
diff lwr upr p adj
Middle-Lower 0.72714285714 -0.1823216115 1.6366073258 0.0403753799
Upper-Lower 0.02142857143 -0.8880358972 0.9308930401 0.9966209751
Upper-Middle -0.70571428571 -1.6151787544 0.2037501829 0.0472426782
We see that the p-value for mean differences of Middle-Lower and Upper-Middle is less than 0.01, so, the mean differences of Middle-Lower and Upper-Middle are significantly different. Thus, the middle class mean GPA is significantly different from upper and lower classes.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.