Linked Questions

230 votes
3 answers
194k views

R's lmer cheat sheet

There's a lot of discussion going on on this forum about the proper way to specify various hierarchical models using lmer. I thought it would be great to have all ...
70 votes
3 answers
145k views

Questions about how random effects are specified in lmer

I recently measured how the meaning of a new word is acquired over repeated exposures (practice: day 1 to day 10) by measuring ERPs (EEGs) when the word was viewed in different contexts. I also ...
alwin hoff's user avatar
19 votes
3 answers
4k views

Interpreting three forms of a "mixed model"

There's a distinction that's tripping me up with mixed models, and I'm wondering if I could get some clarity on it. Let's assume you've got a mixed model of count data. There's a variable you know you ...
Fomite's user avatar
  • 23.5k
11 votes
1 answer
7k views

Questions about specifying linear mixed models in R for repeated measures data with additional nesting structure

Data Structure ...
Cel's user avatar
  • 275
4 votes
1 answer
3k views

Crossed fixed effects model specification including nesting and repeated measures using glmm in R

Background: I am interested in looking at the effects that Culture, Treatment and Time have ...
LiveLongandProsper's user avatar
5 votes
1 answer
7k 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 ...
ClarPaul's user avatar
  • 1,270
8 votes
1 answer
3k views

how to understand random factor and fixed factor interaction?

Let's say I fit this model to the Oats data set lmer(yield ~ Variety + (1|Block/Variety), data=Oats) ...
locus's user avatar
  • 1,623
4 votes
1 answer
2k views

Nested crossed random effects for repeated measures data

Problem There are two excellent CV posts on specifying crossed effects models (post 1, post 2). The issue I'm trying to wrestle with pertains to part of the answer to post 2, in particular how to ...
Joshua Rosenberg's user avatar
0 votes
1 answer
2k views

Mixed model (Multilevel) with two INDEPENDENT Random Effects [lmer]

I like to estimate a mixed model with two Random Effects, that are independent of each other and among themselves. I use Panel data with a nested structure (counties $j$ nested within regions $i$). ...
user35425's user avatar
  • 171
5 votes
1 answer
193 views

is it correct to nest fixed effects within random factors?

In this post @Ben Bolker wrote in his answer that for the interaction between station and day we could write ...
locus's user avatar
  • 1,623
2 votes
1 answer
1k views

Mixed effect modelling with multiple, nested random variable

Goal: comparing pitch (Hz) on three types of words Dependent variable: Hz Fixed predictor variable: word-type, points (measurements taken from five points on each token, to capture Hz change within ...
Yang's user avatar
  • 33
1 vote
0 answers
2k views

How to specify a mixed model in lmer for between-subjects longitudinal study?

I'm struggling to figure out the right model specification for my data. Here's my design: a between-subject longitudinal study, with two Type of participants (...
Roder's user avatar
  • 11
3 votes
2 answers
183 views

Nested data correction with mixed models

We have collected data from n patients, with each patient having one eye treated and the other untreated. We would like to see if the treated eye progresses differently to the untreated eye using ...
JP1's user avatar
  • 201
5 votes
1 answer
1k views

Can a factor be regarded as both random and fixed effect?

I have a question about nested mixed effect model. For example I have species A with different populations; these populations belong to two kinds of habitat types (with or without predators). So I ...
Bin's user avatar
  • 51
3 votes
1 answer
173 views

Difference between `fix1 + (1|cluster1)` and `fix1 + (1|fix1:cluster1)` when specifying random intercept using lme4 in R

I see sometimes people using two different ways to specify the random effects when conducting multilevel modelling with lme4 in R. ...
user8460166's user avatar

15 30 50 per page