Lately I keep encountering the same problem and I'm wondering whether other people have been able to get around it. I'm running a mixed effects model using lmer(). My model has by-subject and by-item intercepts and slopes, and random correlation parameters between them. Since the current version of lmer() does not have MCMC sampling implemented, I cannot use pvals.fnc(). I get this message:
Error in pvals.fnc(m, withMCMC = T) :
MCMC sampling is not implemented in recent versions of lme4
for models with random correlation parameters
pvals.fnc() is also the function I use to get confidence intervals (HPD95lower and HPD95upper were two columns in the pvals.fnc output). Does anyone know of an alternative way of getting confidence intervals for the fixed effects estimates in the model? Or does using models with random correlations means that we can no longer get CIs from R?
Thanks!
NOTE: I've seen this question asked in other forums in slightly different ways. However, the answers always seem to involve (1) calculating something different as an alternative to the confidence intervals, (2) some complicated solution that is unclear (at least to me) how to implement. I would like to know if there is some alternative way of computing CIs that is both mainstream (so that other researchers can use it) and has a function to do it in R, since I am not a programmer and I feel that trying to create that function myself would be error prone.
?pvalues
help page in the the new version oflme4
includes a lot of information on this topic. $\endgroup$lme4
in a while and I didn't know about these useful features. I am trying to useconfint
now, trying to get profile CIs. Do you know if there is a simple way to have it estimate CIs only for the fixed effects? Otherwise, given my the structure of model, it takes forever to run and it also stops if any of the parameters cannot be estimated (which is likely when you have many, I think) $\endgroup$params=
to specify the parameters you want to get CIs for, but this requires you knowing which number corresponds to which parameter, and I don't know how to do that $\endgroup$n_ran <- length(getME(model,"theta"))
; the number of fixed-effect parameters isn_fix <- length(fixef(model))
. Thus you should be able to useparams=(n_ran+1):(n_ran+n_fix)
to get just the fixed effect parameters profiled. $\endgroup$