I am having some trouble running an Anova on categorical variables in R and matching SPSS output. What I need to do is run an anova on the dataset below (its a made up data set). But, I need to know if the mean of each category is significantly from the total mean of all races.
Satisfaction Race
3 Asian
4 Cacasion
5 African American
2 Other
5 African American
3 African American
4 African American
5 African American
2 Asian
3 African American
1 Cacasion
1 Cacasion
1 Cacasion
5 Other
5 Other
5 Other
5 African American
5 Asian
4 Asian
5 Other
5 Other
5 Other
1 Cacasion
4 Cacasion
For example, the mean of all races is 3.5 :
> mean(test$Satisfaction)
[1] 3.5
What I would like to know is if the mean score for each race is significantly different from the total mean of 3.5 and the p-value.
I ran an Anova in R with the following model, but R will set one catagory as the refernce and test is against the others :
> lm.test <- lm(test$Satisfaction ~ test$Race)
> summary(lm.test)
Call:
lm(formula = test$Satisfaction ~ test$Race)
Residuals:
Min 1Q Median 3Q Max
-2.5714 -1.0000 0.4286 0.8482 2.0000
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 3.8571 0.5023 7.679 2.18e-07 ***
test$RaceAsian -0.6071 0.8330 -0.729 0.4745
test$RaceCacasion -1.8571 0.7394 -2.512 0.0207 *
test$RaceOther 0.7143 0.7103 1.006 0.3266
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 1.329 on 20 degrees of freedom
Multiple R-squared: 0.391, Adjusted R-squared: 0.2997
F-statistic: 4.28 on 3 and 20 DF, p-value: 0.01732
The output is telling me that the mean for African American is 3.8571 and is significantly different from the mean of the caucasian group. It is not different from the mean of group Asian and Other.
Is there a way for me to set the intercept to 3.5 in R and get significant compared to the mean and not the reference group. Or should I be using another tests altogether? My stats isn't that great so if its another tests a brief explain on which test and how to run it in R would be great.