Hallo,
Ik probeer in R de output te genereren die ik in het boek van Field tegenkom op blz 628.
Ik gebruik:
library(haven)
data <- read_sav("C:/.../Goggles.sav")
# zorg ervoor dat data frame goed staat.
data <- as.data.frame(data)
rosetta::fanova(data=data, y= 'Attractiveness', between=c('Alcohol', 'FaceType'), levene=TRUE, plot=TRUE, digits=4)
de output is dan:
Between-subjects factor Alcohol does not have class 'factor' in dataframe 'data'. Converting it now.
Between-subjects factor FaceType does not have class 'factor' in dataframe 'data'. Converting it now.
Flexible Analysis of Variance was called with:
Dependent variable: Attractiveness
Factors: Alcohol & FaceType
Anova Table (Type III tests)
Response: Attractiveness
Sum Sq Df F value Pr(>F)
(Intercept) 98.000 1 71.5826 1.285e-10 ***
Alcohol 39.250 2 14.3348 1.796e-05 ***
FaceType 33.063 1 24.1500 1.406e-05 ***
Alcohol:FaceType 23.292 2 8.5065 0.0007913 ***
Residuals 57.500 42
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Partial omega squared effect sizes
value
0.4525439
Parameter estimates, omnibus F-test and R-squared values
Call:
stats::lm(formula = res$intermediate$formula, data = data, contrasts = contrastFunction)
Residuals:
Min 1Q Median 3Q Max
-2.500 -0.625 -0.125 0.625 2.500
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 3.5000 0.4137 8.461 1.29e-10 ***
Alcohol1 1.3750 0.5850 2.350 0.023531 *
Alcohol2 3.1250 0.5850 5.342 3.49e-06 ***
FaceType1 2.8750 0.5850 4.914 1.41e-05 ***
Alcohol1:FaceType1 -1.2500 0.8274 -1.511 0.138319
Alcohol2:FaceType1 -3.3750 0.8274 -4.079 0.000197 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 1.17 on 42 degrees of freedom
Multiple R-squared: 0.5154, Adjusted R-squared: 0.4578
F-statistic: 8.936 on 5 and 42 DF, p-value: 7.677e-06
### Levene's test for homogeneity of variances:
F[5, 42] = 0.7171, p = .61419.
Met name de berekende F-waarden en de sum of squares kloppen niet met wat er in de output van het boek staat.
Doe ik iets fout is of is dit het gevolg van een iets andere methodiek in R (wat ik me moeilijk kan voorstellen.
Ik ontvang hier graag wat hulp bij.