2
$\begingroup$

I have a linear mixed-effects model with subject and event as random effects and a fixed effect of rating (range 1-4) that is the same for all subjects (i.e. each event has a one rating for all subjects):

value ~ rating + (1|subject) + (1|event)

I would like to plot the mean (across subjects and events) and standard error for each rating value, but am not sure how to calculate the standard error so it incorporates the variance across subjects and events. I tried using the effects package in R, which gives me fit and SE. If I have a fixed effect with only two levels, the fit equals the mean. If the fixed effect has four levels, the fit doesn't equal the mean and I'm not sure how to interpret it (and so not sure the provided SE is the one to use).

Any suggestions on how to do this? Thanks!

$\endgroup$

1 Answer 1

2
$\begingroup$

As Murphy has it, I realised the solution to this after posting. I'm posting the answer in case anyone encounters the same issue: Using the effects package in R, if rating is numerical, the fit will be the best fit of the model constrained by the values in rating. To get the means and relevant SE, rating must be a factor, where each value of rating is "free" to get a separate value

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.