lmer (& siblings glmer & nlmer) are functions in the R package lme4 that fit mixed effects models (ie, models that include fixed & random effects). These models can be non-linear in the sense that the dependent variable is transformed by a non-linear function (eg, logistic or log) to accommodate ...

learn more… | top users | synonyms

0
votes
0answers
3 views

How is correlation between fixed intercept and fixed effect calculated in lmer of R, lme4?

When I fit any model in lmer(), summary identifies a correlation between fixed effect(s) and the (fixed) intercept. How should ...
0
votes
0answers
3 views

merTools predictInterval() for model with nested random effect [migrated]

Does predictInterval() from the merTools package not like nested random effects? For example, using the ...
0
votes
0answers
26 views

Model Selection - adding categorical covariates to mixed linear models

I have a dataset consisting of genotypes (crop lines) being grown in multi-replication trials across environments. Here is the mixed linear model I've been working with: $$ Y_{ijk} = \mu + G_i + E_j ...
0
votes
1answer
33 views
0
votes
0answers
16 views

Specify a nested model in lavaan?

I am interested in fitting two models using the 'lavaan' package in R. I have a psychotherapy data set that has a nested structure - patients nested within therapists. I'm interested in fitting a ...
1
vote
1answer
35 views

How to specify a simple model in lmer/lme4: do I need explicit nesting?

I am measuring response time RT_log for 3 experimental manipulations (Conditions), and there are 4 ...
0
votes
0answers
19 views

Multilevel model using negative binomial

I'm trying to look at between region variation (5 regions in total) in disease cases and the influence of climatic factors. How do interpret the variance given such a small value i.e variance when ...
1
vote
0answers
61 views

Mixed model with crossed effects and repeated measures - what is correct ‘maximal model’ for use in lmer/lme4? [R]

Objective I have a crossed and implicitly nested design and am trying to validate the correct ‘maximal’ model (including all linear and pairwise interactions of the variables) for use in ...
1
vote
0answers
16 views

Application of Huber-White Variance Estimates in GLMER

I'm currently working on an analysis in R using GLMER mixed-effects model with a logistic regression framework under the lme4 package. I would like to include empirical (Huber–White sandwich) variance ...
1
vote
1answer
14 views

Using re.form= in predict.merMod() for a lmer() model

If I fit a model with a random-intercept and random-slope then use predict.Mermod with re.form = ~ (1|Subject), my gut told me ...
1
vote
0answers
37 views

Fixed effect not siginificant in multi-level model, what else to report besides significance?

I'm studying the effects of a teaching style intervention on student motivation. I use multi-level modeling since students are nested within teachers. The condition main effect is not significant (p = ...
0
votes
0answers
33 views

Back-transform coefficient from linear mixed model with log-transformed response

I ran a linear mixed model (lme4::lmer in R) with a log-transformed (base 2) response, and predictors were not transformed. I want to back-transform my coefficients to make a statement about effect ...
0
votes
1answer
23 views

How to preserve order of factor levels in R [closed]

I have an unbalanced longitudinal data for glucose levels of some patients coming to a hospital. My data looks like id, date, glucose_level. As I want to find the ...
0
votes
0answers
34 views

adding interaction term gives opposite relation

I am trying a mixed model in R (lme4). The objective is to evaluate the average glucose level of patients in a hospital is decreasing in the last four years. The model is simple that glucose values ...
1
vote
0answers
52 views

How do the observed values of random effects enter the computation of linear mixed models?

How do the actual values of the random variable $b$, collected from observation, enter into the maximum likelihood computations for the linear mixed effects model? Specifically, for the model ...
0
votes
1answer
63 views

Nesting random effect within fixed effect using lmer() of lme4 in R

Problem I want to fit a model using the R lme4 lmer function, and I'm not sure how to specify a random effect that is nested within a fixed effect. Setup I am applying a ...
0
votes
0answers
31 views

Linear Mixed Model with 3 variables

I would appreciate some assistance with setting the statistical analyses of my experiment. During my experiment 14 participant's motor responses (ptp) were tested ...
1
vote
0answers
15 views

Post-hoc tests linear mixed model lsmeans error [migrated]

I have a question about running post hoc tests on linear mixed models: I am running a linear mixed model in lme4 with 3 groups, 5 snakes per group, each group at a ...
1
vote
1answer
39 views

fitting a binomial glmer or an lmer to a proportional response variable

I'm hoping somebody can help with what I think is a relatively simple question, and I think I know the answer but without confirmation it has become something I just can't be certain of. I have some ...
0
votes
0answers
23 views

Within-subject repeated linear mixed-effects design in lmer

I would like to know more about the correct way to specify a within-subject repeated measures LME. In the study, participants (id) saw videos of 4 different conditions (each participant saw all 4 ...
0
votes
0answers
11 views

factors associated with change

Can someone help me to find the factors associate with change. I have repeated measures data of blood glucose of 700 patients for continuous four years. I have few other information about these ...
0
votes
1answer
59 views

Interaction term in a linear mixed effect model in R

I am attempting to analyze the effect of two categorical variables (landuse and species) on a continuous variable (...
0
votes
1answer
41 views

How to simulate data to demonstrate mixed effects with R (lme4)?

As a counterpart to this post, I worked on simulating data with continuous variables, lending themselves to correlated intercepts and slopes. Although there are great posts on this topic on the site, ...
0
votes
0answers
33 views

Mediation for mixed model with crossed factors in R

I am looking for a possibility to test for mediation in a scenario where the individual paths (M ~ X, Y ~ M + X) are represented by mixed models with crossed factors (with binary x and continuous m): ...
3
votes
1answer
50 views

Random effect specification in lmer mixed effect model

What is the difference between (1|DNA.concentration/mouse.id) and (DNA.concentration|mouse.id)? What do the symbols ...
0
votes
0answers
24 views

lmer like Anova: visualizing with lsmeans (log transformed)?

I have fitted a linear mixed effects model to my data. I first determined that it was appropriate to log transform my response variable. Here is the equation: ...
0
votes
0answers
42 views

Relationship between linear mixed model assumption checks and repeated-measures ANOVA assumptions

Based on a previous question that I asked about checking assumptions of repeated-measures ANOVAs in R (which turns out to be not so trivial), I'm wondering about the relationship between a ...
0
votes
0answers
38 views

R: Confusion about research question using GLM

I have a dataset with 3 colonies (A, B and C, see below). Each colony is divided into 2 treatments: control and DWV. I use a GLM to test wether there is a difference of the life expectancy ...
0
votes
1answer
26 views

Post hoc test (lsm) gives unverifiable t and p values for my lmer model

I have a model of the following structure: lme4::lmer(formula = signal ~ factorA + factorB + factor C + (1 | subj), data = s) and find a significant main ...
0
votes
0answers
14 views

Interval Estimates of Fixed and Random Effects in lmer [duplicate]

I am fitting an lmer model like so: tolerance.lmer = lmer(tolerance ~ 1 + time + (1 + time | id), data = tolerance_long) And I am supposed to calculate the ...
0
votes
0answers
13 views

Specifying parameters in lmer package to compute ICC

I have a dataset as shown below ...
0
votes
1answer
81 views

Extracting values from a 'lmerMod' object in lme4 [closed]

I'm trying to extract the value of the Variance from a Random Effects model built in R, using the lme4 package: ...
0
votes
0answers
11 views

Accounting for uncertainty in random slope estimation

My question relates to calculating the uncertainty associated with the estimation of slopes in a varying intercept, varying slope hierarchical model. I would like to calculate the effect of a ...
0
votes
0answers
65 views

Post-hoc test for lmer

I am running mixed models using lmer, and am having trouble running a post-hoc test to look at the significance between variables. The first 5 rows of my dataset (out of 119) looks like this: ...
0
votes
0answers
25 views

Are there easy tools for visualizing the hierarchical structure of mixed models?

I'd like to produce graphs of the data structure of mixed models, like this from Schielzeth & Nakagawa 2013 I am teaching a seminar on mixed models to 1st year grad students and want to ...
0
votes
0answers
19 views

Correcting for multiple comparisons within lmer

I'm running a mixed effects model in lme4::lmer in R to test for two interaction effects. My question is: do I need to control ...
0
votes
0answers
15 views

Linear mixed effect models with same dependent variable

I have a df with brain activity from two groups (A and S) at different time points (time = 1, 2 ,3 ,4) with one dependent variable (reaction time = mean_RT) for two different conditions (cond= weak, ...
0
votes
1answer
33 views

Discrepency between lmerTest, mixed and aov results

I am running a mixed effects model to explore the relationship between factors of Group (2 levels), Age (quantitative), and ...
1
vote
0answers
9 views

Syntax for unbalanced block design with nesting

I am trying to run a model in which I have site as a blocking factor, and two layers of nested random effects due to sub-sampling. The nesting layers are-> plant[flower[robbing status]]. My response ...
2
votes
2answers
105 views

Maximal model for linear mixed-effects model for repeated mesaures design

I have a dataset of a psychological experiment with two within-subject factors. For simplicity, let's assume I'm collecting reaction time (RT) for the stimulus factors of color (red/blue/green) and ...
1
vote
0answers
18 views

Assign a random factor to multiple observations in a factor level, rather than across factor levels?

Assume you have a longitudinal repeated measures dataset from patients whose heartrate is measured while running at two different speeds. Ideally each patient would be measured once a day, but often a ...
1
vote
1answer
82 views

Multilevel model with nested repeated measures design

I am new with R and I am trying to use multilevel modelling for my dataset using the function glmer (for a binomial outcome variable) and ...
0
votes
0answers
11 views

How can the fit of a multilevel model including a new fixed effect improve if the fixed effect is not significant at all

I am trying to fit a multilevel model using the lmer package in R. My model has two levels (the upper level is "country"). I include a level 2 fixed effect (i.e., constant for each country). Here is ...
0
votes
0answers
30 views

How to interpret a covariate in ANOVA and why are type II vs type III SS so different?

I am trying to understand the effect of a covariate (COVAR) in a linear mixed effects model with 2 categorical IVs (IV1, IV2). In order to illustrate where I am struggling, I had to paste the rather ...
0
votes
0answers
25 views

Problem understanding linear modeling with random effects and covariates

I am new to linear modelling and I am struggling modelling random effects. I have an experiment where a group of individuals is given a drug (drug A) and another group of individuals is given a ...
1
vote
0answers
142 views

How to explain possitive/negative effect - choosing an appropriate model

I would be very thankful for your assistance on this. I'm looking for a way to explain positive/negative effects on variable probio. So which covariates (...
0
votes
1answer
68 views

When parameters are dropped from fixed effects in lmer, drop corresponding random effects

If I fit an lmer() model with correlated fixed effects, by default it gives me a fit warning ...
0
votes
0answers
52 views

r - Am I setting right the random effects with lmer?

I am new in mixed effect models and I would like some advice into setting my random effects. I have a group of 19 patients (ID) that have measures of atrophy (A) and of 2 markers (B, C) of a disease ...
0
votes
0answers
45 views

ICC in a multi level model with two random effects

My understanding is that intraclass correlation gives you an idea of how much variance your level two factor can explain in overall variance of the dependent variable. It is supposed to give an ...
0
votes
0answers
23 views

Estimating multiple residual terms for mixed effects model in R

I was told that it may be useful to estimate multiple residual terms in a mixed effects model I am trying to build. This is possible in ML-win, but since I am only familiar with R, I am hoping that it ...