Questions tagged [random-effects]

238 questions
0
votes
1 answer

How to get overall F-statistics form a model with random effects

I've been using the lmer function in lme4 and it gives me the coefficients for the independent variables so that I could build the predictive model, but it doesn't give me the F statistics for each factor. I tried to find how to get those (F stats)…
0
votes
1 answer

R: how to extract r squared from lmekin in coxme package

I'm trying to find out how well my mixed model with family effect fits the data. Is it possible to extract r squared values from lmekin functions? And if so, is it possible to extract partial r squared values for each of the covariables?…
b82mo
  • 3
  • 2
0
votes
0 answers

Using new values of random intercepts to predict values in lme4 R package

Let's say we have a following prediction: mod <- y ~ x + (1+x | Subject) Is there a way to predict new values in y, using the predict() function not by specifying only new fixed effects by using newdata arguement, but also by specifying a single…
User33268
  • 159
  • 1
  • 11
0
votes
1 answer

3 way interaction between random and fixed effects

I have a set of data that looks like this: rep stage line temp surv 1 L 149 18 0.6 2 L 149 18 0.7 3 L 149 18 0.25 1 A 149 18 1 2 A 149 18 1 3 A 149…
Melderon
  • 365
  • 1
  • 16
0
votes
0 answers

Modifying axis scales on random effects plots using lme4 and ggCaterpillar in R with ggplot2

I was wondering if someone could help me with something. I have a mixed effects model fitted with lme4 and I have extracted the random effects to plot in a dotplot. I have followed the very helpful code pasted below and have got the plot shown.…
LauRa28
  • 33
  • 3
0
votes
1 answer

Nonlinear model with many independent variables (fixed effects) in R

I'm trying to fit a nonlinear model with nearly 50 variables (since there are year fixed effects). The problem is I have so many variables that I cannot write the complete formula down like nl_exp = as.formula(y ~ t1*year.matrix[,1] +…
zy.G
  • 43
  • 1
  • 10
0
votes
0 answers

automated drop1 in R according to AIC

First of all I am fairly new to R. So please do not be so harsh in your comments. Thanks in advance for any help/link/how-to/example; those will be much appreciated. I have a model like this: b <- lmer(metric1~a+b+c+d+e+f+g+h+i+j+k+l+(1|X) + (1|Y),…
borgs
  • 3
  • 5
0
votes
0 answers

How do I construct this random effect model in R?

I have a biomedical data named data1, and I want to construct a random effect model to analyze 'eGFR'(a continuous variable), there are four covariates I am interested in this study, 'sex', 'diabetes state', 'smoking state', 'treatment time'. If I…
Wayne
  • 1
  • 1
0
votes
1 answer

Stata using xtreg for cluster random effects models

I want to use xtreg to get the random effects intercepts for individual groups and their predicted values. However, all of the predict commands are just populating all of the groups with the constant value. Using 1 year of data: xtset group // set…
username
  • 75
  • 5
0
votes
1 answer

How to analyze panel data in R using logistic regression (glmmML)?

Currently, I am conducting research on the probability of a CEO leaving the company (binary variable="1" if left). My data is unbalanced panel data for 50 companies with 51 individuals in it for the period 2013-2015. I was trying to run two…
0
votes
1 answer

How to modify random effects in lmer

Is there a way to modify (overwrite) random-effects within a lmer-model? For fixed effects there is a slot called my_lmer@beta and I could alter the fixed effects using: my_lmer@beta[1] <- 0.5 Is there a similar way to do this for random effects?…
winwin
  • 384
  • 6
  • 20
0
votes
0 answers

A loop to incorporate random effects into generalized linear mixed models using the function lmer()

Below is a small subset of my data frame. The actual dataframe has an explicit name for each variable; not just "DepVar1, and DepVar2 (2 response variables)" or "IndVar (1-9)" (9 explanatory variables - 1 categorical and 8 continuous variables). I'd…
Alice Hobbs
  • 1,021
  • 1
  • 15
  • 31
0
votes
0 answers

Using a boundary file from a shape file in a BayesX model

I am using a shape file .shp and then converting it to a boundary file .bnd using BayesX to use it as a random effect in my model. But it throws back an error of ERROR: map is disconnected, spatial effect cannot be estimated from theBayesX log file.…
Keniajin
  • 1,649
  • 2
  • 20
  • 43
0
votes
1 answer

How can I include repeated measures to my lmer correctly

In my study I was sampling the same sites in different regions for many years. Each site has different properties in each year, which is important for my research question. I want to know, if the properties of the site affect biodiversity on the…
MelChi
  • 9
  • 1
0
votes
0 answers

R plm package - error when trying to fit a random effect

When I try to fit the following random effect on a panel…
José
  • 921
  • 14
  • 21
1 2 3
15
16