I am currently trying to run a mixed effect model in R for a study I am conducting.
I am looking at the effect of target ethnicity on objectification and whether affinity mediates this relationship.
Each participant rated the warmth and competence of three targets (Asian, African American and Caucasian target) and a composite objectification score was computed by averaging the z-scored index for each item, per target.
The data look something like this:
participant <- c(1,1,1,2,2,2) target_ethnicity <- ("caucasian", "africanamerican", "asian", "caucasian", "africanamerican", "asian") objectification <- c(1.00, 0.90, 0.97, 0.78, 0.76, 0.89) affinity_level <- c(5, 7, 7, 4, 6, 7) df <- data.frame(participant, target_ethnicity, objectification, affinity_level)
So for each participant, there are three scores for objectification (one for each target) and three scores for affinity (one for each target).
When computing the mixed effect model, I used the code:
mod1 <- lmer(objectification ~ target + affinity + (1|participant), data = df)
When looking at the summary with my full data set of 131 participants it shows the following:
asian: B = 0.15976, t(259.87)= 4.159, p <.05 black: B = 0.07963, t(261.30)= 2.054, p<.05 affinity: B = 0.13647, t(338.11) = 3.169, p<.05
I have a few questions about this which I was wondering if anyone could advise me on:
(1) I am confused why the degrees of freedom are all different?
(2) I want to test the assumptions of this model, but functions like qqPlot() do not work as I get the error message "Error in x[good]: object of type 'S4' is not subsettable In addition: Warning message: In is.na(x) : is.na() applied to non-(list or vector) of type 'S4'"
(3) When I look for outlying data points is it necessary to use the influence function before looking at dfbetas and cook's distance like I have done below? How do you choose what the cut off point is to remove outliers in mixed effect models?
outliers <- influence(mod1, group="participant") dfbeta <- dfbetas.estex(outliers) cooks <- cooks.distance.estex(outliers)
(4) How do I interpret the mediator affinity in this case? How would I know whether it is mediating? Is it necessary to or useful to do a simple slopes plot?
(5) How do I extract the R^2 and adjusted R^2 values for this model as well as the F statistic?
I know this is a lot of questions, but I am very new to mixed effect models and am quite confused.