Questions tagged [random-effects]

238 questions
0
votes
0 answers

Cox PH model, how to control for multipel events

I´m working on a time-to-event modell in R using the coxph function in the survival package. I´m analysing animal movements until they pass the study area which consists of 2 zones. Each individual can have multiple events before the final passing…
Mattias
  • 1
  • 1
0
votes
0 answers

Specification of a mixed model using glmmLasso package

I have a dataset containing repeated measures and quite a lot of variables per observation. Therefore, I need to find a way to select explanatory variables in a smart way. Regularized Regression methods sound good to me to address this problem. Upon…
0
votes
0 answers

Using random intercepts or z-standardizing within factors: Two identical ways to account for variance between factors?

I have the following (simple?) question about statistics: I have a dataset where I look for correlations between variables and would like to control for differences between factor levels. For visualization, consider this example: N = 100 people…
MR13
  • 39
  • 4
0
votes
1 answer

" Error: Invalid grouping factor specification"

I'm trying to create a mixed effects model for some data I'm analyzing. It previously worked as a fixed effects before I decided to change one of the variables (countryfactor) to a random effects (random intercept) variable. The issue is that when I…
0
votes
0 answers

Multinomial logit with random effects does not converge using mblogit

I would like to estimate a random effects (RE) multinomial logit model. I have been applying mblogit from the mclogit package. However, once I introduce RE into my model, it fails to converge. Is there a workaround this? For instance, I tried to…
0
votes
1 answer

Error in eval(family$initialize, rho) : y values must be 0 <= y <= 1 when fitting a GLMM

Trying to fit a GLMM that incorporates random effects for isofemale and population, and includes fixed effects and interactions that test: Do males and females have different heat shock tolerance? Do flies from different regions have different heat…
0
votes
0 answers

How to estimate correlated random effects (CRE) with python?

I'm working with water and sewage provision data from Brazil, 5500 obs, unbalanced panel. I want to estimate a correlated random effects (CRE) model, and since Wooldridge tells that estimates are the same under CRE and fixed effects I estimated the…
0
votes
1 answer

How do you incorporate random effects with interactions?

I am looking for advice on the proper model notation to test for differences between sex in my data. My goal is to determine whether or not I need to split my data into M and F, or if I can keep my data combined (I hope that I will be able to keep…
bruss
  • 21
  • 3
0
votes
1 answer

MixedLMResults object return NaN BIC. What can be the reason?

Here is my code: import statsmodels.formula.api as smf md = smf.mixedlm("dep ~ indep", df, groups=df["groups"], re_formula='~indep') mdf = md.fit(method=["lbfgs"]) mdf.bic returns nan as output. What can be the reason? If it is package related…
0
votes
0 answers

Multiple columns in one random effect GLMER

I'm trying to find variance in infectivity trait of animals in different herds. Each herds contains a fixed number of offspring from 5 different sires. Example of…
0
votes
0 answers

Can I use "continuous" random effects (using lmer) in this instance?

Can I use "continuous" random effects in this instance? I have the following lmer model: m1 <- lmer(V1 ~ V2 + V3 + V4 + V5 * V6 + (1|V7) + (1|V8) + (1|V9), data = data) V1 is resultant mean error (continuous between 0 and 1) V2 is categorical…
0
votes
1 answer

Extract confidence interval for a combination (sum) of variance estimates from a mixed model (lme4)

I use a mixed model to separate the variance of some measurement into between- and within group variance. The model looks like this: library(lme4) k <- 100 i <- 5 group_mean <- rnorm(k, 0, 1) y <- rnorm(k*i, rep(group_mean, each = i), 0.5) df <-…
JohannesNE
  • 1,343
  • 9
  • 14
0
votes
0 answers

Mixed-effects model for stepwise regression (lme4 syntax)

I am trying to put together a maximal model for stepwise regression ('backward selection') using lme4 syntax and would be very grateful for any help as this is the first time I am doing this. Here's my situation: In the context of a linguistic…
Jake
  • 1
  • 2
0
votes
1 answer

on the predict.merMod function arguments

In the function predict.merMod of the lme4 package, what is the difference between the following arguments: allow.new.levels=TRUE, re.form=NA and re.form=~0 if we have only a random intercept?
user1988
  • 29
  • 1
  • 7
0
votes
1 answer

Beta coefficients in a panel data random effects regression model

I wanted to get beta coefficients in my panel data random effects regression model in Stata. But then I noticed that the option "beta" is not allowed in the xtreg command. It made me think if it is probably wrong to want standardised coefficients in…
tish
  • 3
  • 2