Questions tagged [random-effects]

170 questions
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
  • 81
  • 8
3
votes
1 answer

Most straightforward R package for setting subject as random effect in mixed logit model

I have a dataset in which individuals, each belonging to a particular group, repeatedly chose between multiple discrete outcomes. subID group choice 1 Big A 1 Big B 2 Small B 2 Small B 2 Small C 3 Big …
jjcii
  • 109
  • 2
  • 9
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…
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
1 answer

One-way random-effects ANOVA in SAS: PROC GLM or MIXED?

I'm attempting to conduct a simple one-way random-effects ANOVA in SAS. I want to know if the population variance is significantly different than zero or not. On UCLA's idre site, they state to use PROC MIXED as follows: proc mixed data = in.hsb12…
Meg
  • 766
  • 1
  • 7
  • 19
3
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…
3
votes
2 answers

Extracting the number of observations and the modes of random effects from a mer object

I have a mer object created with a called to lmer(). I can obtain the random effects with ranef() but I would also like to have corresponding number of observations for each random effect - is there an easy way to do that ? Additional Info: I may…
Robert Long
  • 2,785
  • 4
  • 18
  • 38
2
votes
1 answer

How to determine the correct mixed effects structure in a binomial GLMM (lme4)?

Could someone help me to determine the correct random variable structure in my binomial GLMM in lme4? I will first try to explain my data as best as I can. I have binomial data of seedlings that were eaten (1) or not eaten (0), together with data of…
Slimke
  • 23
  • 4
2
votes
0 answers

Linear mixed effects models in R - mixed advice on random effects factors with less than 5 levels

I ran an experiment where I moved subjects arm about the elbow to a reference position, returned it to a home position and then asked them to try and replicate the position, all without vision of their arm. I then measured the error in their…
Nkitchen1
  • 21
  • 1
2
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
  • 137
  • 5
2
votes
0 answers

How do I specify a random slope for a specific contrast in lme4?

With the following dataset... Subj <- rep(1:10, each = 10) Item <- rep(1:10, times = 10) IV1 <- rep(1:5, times = 20) DV <- rnorm(100) library(data.table) data <- as.data.table(cbind(Subj, Item, IV1, DV)) data$Subj <- as.factor(data$Subj) data$Item…
Dave
  • 152
  • 1
  • 2
  • 13
2
votes
1 answer

Random slopes Cox Proportional Hazards

I have been trying to use coxme to extract random slopes for each of the covariates in my model. library (coxme) Start <- runif(5000, 1985, 2015) Stop <- Start + runif(5000, 2, 10) S <- data.frame ( X1 <- runif(5000, 5.0, 7.5), X2 <-…
AEM
  • 829
  • 1
  • 8
  • 20
2
votes
1 answer

Getting fixed effect estimates but not pvalues with glmmLasso

Hi I am trying perform a variable selection using the lasso approach, but my model includes a random effect. I have run the model without the random effect using both the cv.glmnet and optL1 functions in glmnet and penalized (and got results);…
2
votes
2 answers

Estimating logsitic parameters and random effects with nlme

I have managed to fit logistic curves to fit growth models for 129 fish belonging to 3 groups. Unfortunately the parameters I got were not consistent and very often the models I tried have crashed. Therefore I've simulated a data set on which I've…
Max13
  • 21
  • 1
2
votes
1 answer

Recreating SAS mixed model output (including F tests) in R

I recently took an ANOVA class in SAS, and am rewriting my code in R. Thus far, translating random effect (and mixed effect) models from SAS to R has eluded me. The output I get from R is very different from SAS: the SS and F value are different,…
dkae
  • 263
  • 2
  • 8
1
2
3
11 12