lme4

A caterpillar plot of just the “significant” random effects from a mixed effects model

点点圈 提交于 2021-01-21 04:20:06
问题 I've had great experiences asking for help here before and I'm hoping to get some help again. I'm estimating a rather large mixed effects model in which one of the random effects has over 150 different levels. That would make a standard caterpillar plot to be quite unreadable. I would like, if all possible, to get a caterpillar plot of just the levels of the random effect that are, for a lack of better term, "significant". That is: I want a caterpillar plot in which either the random

Random slope for time in subject not working in lme4

寵の児 提交于 2021-01-20 18:39:09
问题 I can not insert a random slope in this model with lme4(1.1-7): > difJS<-lmer(JS~Tempo+(Tempo|id),dat,na.action=na.omit) Error: number of observations (=274) <= number of random effects (=278) for term (Tempo | id); the random-effects parameters and the residual variance (or scale parameter) are probably unidentifiable With nlme it is working: > JSprova<-lme(JS~Tempo,random=~1+Tempo|id,data=dat,na.action=na.omit) > summary(JSprova) Linear mixed-effects model fit by REML Data: dat AIC BIC

How to change contrasts to compare with mean of all levels rather than reference level (R, lmer)?

为君一笑 提交于 2020-12-13 04:48:10
问题 I have a dataset for which each row is one visit to a store by a salesperson and the fields include "outlet" (store ID), "devices" (how many electronic devices the salesperson sold) and "weekday" (the day of the week on which the salesperson was in the store). I want to work out whether one weekday is better than the others for sales, so instead of comparing all the days of the week to e.g. Monday I want to compare them to the mean of all the days of the week. I am using the lmerTest function

Correct model in R using lmer

血红的双手。 提交于 2020-08-08 18:22:33
问题 I have a question regarding the correct model setup in R using lmer. This is a repeated measures experiment Each subject (20 in total) completed 4 different task for each stimulation condition (anode, cathode, and sham). The dependent variable is reaction times (rt) I used this model but I am not sure if its correct. I am more concerned if the random effects are correctly assigned model<- lmer(rt ~ task * stimulation + (task * stimulation|subject), data=dat) Any help will be appreciated.

Correct model in R using lmer

耗尽温柔 提交于 2020-08-08 18:20:16
问题 I have a question regarding the correct model setup in R using lmer. This is a repeated measures experiment Each subject (20 in total) completed 4 different task for each stimulation condition (anode, cathode, and sham). The dependent variable is reaction times (rt) I used this model but I am not sure if its correct. I am more concerned if the random effects are correctly assigned model<- lmer(rt ~ task * stimulation + (task * stimulation|subject), data=dat) Any help will be appreciated.

estimate a repeated measures random effects model with a nested structure using `plm()`

允我心安 提交于 2020-07-08 20:39:06
问题 Is it possible to estimate a repeated measures random effects model with a nested structure using plm() from the plm package? I know it is possible with lmer() from the lme4 package. However, lmer() rely on a likelihood framework and I am curious to do it with plm() . Here's my minimal working example , inspired by this question. First some required packages and data, # install.packages(c("plm", "lme4", "texreg", "mlmRev"), dependencies = TRUE) data(egsingle, package = "mlmRev") the data-set