Questions tagged [random-effects]
238 questions
4
votes
1 answer
individual random effects model with standard errors clustered on a different variable in R (R-project)
I'm currently working on some data from an experiment. Thus, I have data about some individuals who are randomly assigned to 2 different treatments. For each treatment, we ran three sessions. In each session, participants were asked to make a…

sciacallojo
- 43
- 2
4
votes
1 answer
Survey Weighted Random Effects Logit Model in R
I am trying to predict a binary outcome with a model that includes a random effect using survey data. I've included a description of the sampling design below, so feel free to comment on my survey weighting approach. My primary question is how to…

mike
- 22,931
- 31
- 77
- 100
3
votes
1 answer
"iteration limit reached" in lme4 GLMM - what does it mean?
I constructed several glmer.nb models with different combinations of random intercepts, and for one of the models (nested random intercepts, with the lowest AICc), I consistently get: "iteration limit reached", without the usual "Warning message:
In…

kdarras
- 389
- 1
- 5
- 16
3
votes
1 answer
How to reproduce average marginal effects from xtlogit model
I am interested in reproducing average marginal effects from a random effects logit model (run in Stata using xtlogit). I understand how to reproduce the average marginal effects from a logit model using the Delta method. For instance, in the code…

Eunice
- 139
- 7
3
votes
1 answer
How to interpret Random Effects Plot from mgcv
I have a few questions regarding using a random effect in a GAM. First, how do you interpret and communicate the output graph?
I have fire modeled as a random effect in this GAM because it is largely a random occurrence at my different field sites…

Alex Cooper
- 31
- 2
3
votes
1 answer
How to predict gam model with random effect in R?
I am working on predicting gam model with random effect to produce 3D surface plot by plot_ly.
Here is my code;
x <- runif(100)
y <- runif(100)
z <- x^2 + y + rnorm(100)
r <- rep(1,times=100) # random effect
r[51:100] <- 2 # replace 1 into 2, making…

imtaiky
- 191
- 1
- 12
3
votes
1 answer
How to add random and/or fixed effects into cloglog regression in R
Update question on treatment of one variable for fixed effects
I am planning to run a cloglog regression in R with random and/or fixed effects to check for unobserved heterogeneity. Now i have not found anything on how to do this in R only one…

Amy
- 91
- 1
- 12
3
votes
2 answers
prediction for lmer-model with nested random effects
I am currently trying to help a colleague and I simply cannot find a solution. So I am hoping that someone else might be able to help us.
I have a dataset containing weight data assessed with different study designs, for different species in…

I Ho
- 147
- 1
- 6
3
votes
0 answers
Fixing random slopes and random intercepts values in lme4
I'm currently trying to calculate the effect size (Cohen's f^2) of a given effect but need to run a null and partial model with the random effects pre-specified in order to do so (according to Selya et al., 2012 for dealing with continuous…

Brianna Brotherton
- 31
- 1
3
votes
1 answer
Specifying level-3 random intercept in R
I am using the lmer() function (lme4 package) in R for analysing a longitudinal study in which I measured 120 subjects, 6 times. In first instance, I specified a model like this:
library(lme4)
model1 = lmer(DV ~ 1 + X1*X2 + (1+X1|SubjectID),…

Stef
- 33
- 3
3
votes
0 answers
R2WinBugs data entry incompatible copy error for Conditional Binomial likelihood, probit link, Random Effects (Psoriasis example)
I was working on the the guide for calculating the effect size of different treatments using a NETWORK META-ANALYSIS as done in example 6.a.
Here
It works fine in winBugs, but I want to do the analysis in R using R2winugs so that I can automate the…

Lionel Duarte
- 121
- 6
2
votes
1 answer
Standard Error of Variance Component from the output of GLMMadaptive::mixed_model
I am using the {GLMMadaptive} package to fit a mixed effect random slope model. And I need to extract the standard error of variance components from the output of GLMMadaptive::mixed_model(). And from the package documentation, it seems that I can…

shafee
- 15,566
- 3
- 19
- 47
2
votes
1 answer
Model predictions for a nested random effects model in R?
I am trying to fit a mixed model with random effects: lmer model to the dataset df based on this example here. However, I run into an error that says invalid "times" argument. Any suggestions on how to fix it.
set.seed(123)
df <- data.frame(x.axis =…

RPlotter
- 109
- 1
- 2
- 11
2
votes
1 answer
mgcv random effects - extracting estimates and plots
I am using mgcv to fit GAMs with random effects, e.g.:
gam_fit <- gam(y ~ s(age) + s(region, bs='re'),
data = my_data,
method = 'REML')
See Gavin Simpson's excellent post about using random effects in GAMs with…

Shira
- 119
- 5
2
votes
2 answers
glmmTMB predictions error concerning random effect
I am trying to create a raster with predictions for a model, using glmmTMB.
This is based on a model, and a rasterstack.
I converted the rasterstack to a data frame, as I think this is a requirement for the function predict.glmmTMB to run.
The…

Beardedant
- 134
- 8