options(contrasts=c("contr.sum","contr.poly"))
load(url("http://pnb.mcmaster.ca/bennett/psy710/datasets/smile-2023.rda") )
sapply(smile.df,class)
## smile leniency subjID
## "factor" "numeric" "factor"
sapply(smile.wide,class)
## neutral contempt miserable real
## "numeric" "numeric" "numeric" "numeric"
class(smile.mat)
## [1] "matrix" "array"
The command loads the long-format data frame smile.df
,
the wide-format data frame smile.wide
, and the wide-format
matrix smile.mat
.
Use a within-subject ANOVA to evaluate the statistical
significance of the fixed effect of smile
. Adjust the \(p\) value with the Geisser-Greenhouse or
Huynh-Feldt adjustment to correct for deviations from
sphericity.
Use the lmer
command in the lmerTest
package to evaluate the effect of smile
with a mixed model.
Evaluate the effect with an \(F\) test
that assumes sphericity and with a chi-square test that does
not assume sphereicity.
Use the lme
command in the nlme
package
to evaluate the effect of smile
with two mixed models: one
that assumes the variance-covariance matrix of the residuals is compound
symmetric (i.e., the correlations between conditions is constant), and
another that assumes the variance-covariance matrix is symmetric (i.e.,
the correlations between conditions are allowed to differ). Do you
prefer one model over the other? Why or why not?
Calculate the ANOVA estimates of the variance
component and intra-class correlation for subjID
.
Use a linear contrast to evaluate the null hypothesis that
leniency in the real
smile condition did not differ from
average leniency in the other three conditions.