mixed-models

Obtaining random-effects matrices from a mixed model

↘锁芯ラ 提交于 2021-02-18 08:43:31
问题 In my below code, I was wondering how I can obtain the equivalent of out and Ts from an lme() object in the library(nlme) ? dat <- read.csv("https://raw.githubusercontent.com/rnorouzian/v/main/mv.l.csv") library(lme4) x <- lmer(value ~0 + name+ (1| School/Student), data = dat, control = lmerControl(check.nobs.vs.nRE= "ignore")) lwr <- getME(x, "lower") theta <- getME(x, "theta") out = any(theta[lwr == 0] < 1e-4) # find this from `x1` object below Ts = getME(x, "Tlist") # find this from `x1`

Obtaining random-effects matrices from a mixed model

被刻印的时光 ゝ 提交于 2021-02-18 08:42:23
问题 In my below code, I was wondering how I can obtain the equivalent of out and Ts from an lme() object in the library(nlme) ? dat <- read.csv("https://raw.githubusercontent.com/rnorouzian/v/main/mv.l.csv") library(lme4) x <- lmer(value ~0 + name+ (1| School/Student), data = dat, control = lmerControl(check.nobs.vs.nRE= "ignore")) lwr <- getME(x, "lower") theta <- getME(x, "theta") out = any(theta[lwr == 0] < 1e-4) # find this from `x1` object below Ts = getME(x, "Tlist") # find this from `x1`

lmer or binomial GLMM

China☆狼群 提交于 2021-02-11 06:48:11
问题 I am running a mixed model in R. However I am having some difficulty understanding the type of model I should be running for the data that I have. Let's call the dependant variable the number of early button presses in a computerised experiment. An experiment is made up of multiple trials. In each trial a participant has to press a button to react to a target appearing on a screen. However they may press the button too early and this is what is being measured as the outcome variable. So for

lmer or binomial GLMM

五迷三道 提交于 2021-02-11 06:48:09
问题 I am running a mixed model in R. However I am having some difficulty understanding the type of model I should be running for the data that I have. Let's call the dependant variable the number of early button presses in a computerised experiment. An experiment is made up of multiple trials. In each trial a participant has to press a button to react to a target appearing on a screen. However they may press the button too early and this is what is being measured as the outcome variable. So for

glmmTMB with autocorrelation of irregular times

谁说我不能喝 提交于 2021-02-11 00:01:25
问题 I'm putting together a glmmTMB model. I have data collected at a single site over the course of May, every year, for 4 years. Time resolution within year can range from a few minutes (or even same minute) to days apart. The covariance vignette says that the ar1() structure requires a regular time series, but the ou(times + 0 | group) structure can handle irregular times. That said - it looks like the times argument is a factor - how does that work with irregular time structure?? So, for

glmmTMB with autocorrelation of irregular times

柔情痞子 提交于 2021-02-11 00:00:37
问题 I'm putting together a glmmTMB model. I have data collected at a single site over the course of May, every year, for 4 years. Time resolution within year can range from a few minutes (or even same minute) to days apart. The covariance vignette says that the ar1() structure requires a regular time series, but the ou(times + 0 | group) structure can handle irregular times. That said - it looks like the times argument is a factor - how does that work with irregular time structure?? So, for

glmmTMB with autocorrelation of irregular times

假如想象 提交于 2021-02-10 23:59:13
问题 I'm putting together a glmmTMB model. I have data collected at a single site over the course of May, every year, for 4 years. Time resolution within year can range from a few minutes (or even same minute) to days apart. The covariance vignette says that the ar1() structure requires a regular time series, but the ou(times + 0 | group) structure can handle irregular times. That said - it looks like the times argument is a factor - how does that work with irregular time structure?? So, for

combine two plots into one plot in a mixed-model plot

点点圈 提交于 2021-02-08 06:41:06
问题 In my plot below, d_math and d_hyp are each {0,1} variables. Given this fact, in my plot below, I was wondering if we can combine the two plots into one, just like in the desired plot further below? ps. I'm open to any R packages. multivariate <- read.csv('https://raw.githubusercontent.com/hkil/m/master/bv.csv') library(nlme) library(effects) # for plot m2 <- lme(var ~ 0 + d_math + d_hyp + d_math:I(grade-2) + d_hyp:I(grade-2), random = ~ 0 + d_math + d_hyp + d_math:I(grade-2) + d_hyp:I(grade

combine two plots into one plot in a mixed-model plot

早过忘川 提交于 2021-02-08 06:40:55
问题 In my plot below, d_math and d_hyp are each {0,1} variables. Given this fact, in my plot below, I was wondering if we can combine the two plots into one, just like in the desired plot further below? ps. I'm open to any R packages. multivariate <- read.csv('https://raw.githubusercontent.com/hkil/m/master/bv.csv') library(nlme) library(effects) # for plot m2 <- lme(var ~ 0 + d_math + d_hyp + d_math:I(grade-2) + d_hyp:I(grade-2), random = ~ 0 + d_math + d_hyp + d_math:I(grade-2) + d_hyp:I(grade

Alternative optimization algorithms for lmer

喜欢而已 提交于 2021-02-08 06:17:19
问题 The function lmer in the lme4 package uses by default bobyqa from the minqa package as optimization algorithm. According to the following post https://stat.ethz.ch/pipermail/r-sig-mixed-models/2013q1/020075.html, it is possible to use also the other optimization algorirthms in the minqa package How can one use uobyqa or newuoa as optimization algorithm for lmer ? library(lme4) fm1 <- lmer(Reaction ~ Days + (Days | Subject), sleepstudy, control=lmerControl(optimizer="bobyqa")) 回答1: You can't