Skip to main content

Questions tagged [mixed-model]

Mixed (aka multilevel or hierarchical) models are linear models that include both fixed effects and random effects. They are used to model longitudinal or nested data.

Filter by
Sorted by
Tagged with
439 votes
9 answers
887k views

What is the difference between fixed effect, random effect in mixed effect models?

In simple terms, how would you explain (perhaps with simple examples) the difference between fixed effect, random effect in mixed effect models?
Andrew's user avatar
  • 6,298
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 ...
196 votes
1 answer
157k views

Crossed vs nested random effects: how do they differ and how are they specified correctly in lme4?

Here is how I have understood nested vs. crossed random effects: Nested random effects occur when a lower level factor appears only within a particular level of an upper level factor. For ...
Joe King's user avatar
  • 3,862
106 votes
2 answers
67k views

How scared should we be about convergence warnings in lme4

If we a re fitting a glmer we may get a warning that tells us the model is finding a hard time to converge...e.g. ...
user1322296's user avatar
  • 1,625
101 votes
4 answers
65k views

How to choose nlme or lme4 R library for mixed effects models?

I have fit a few mixed effects models (particularly longitudinal models) using lme4 in R but would like to really master the ...
Chris Beeley's user avatar
  • 5,841
100 votes
11 answers
275k views

How to obtain the p-value (check significance) of an effect in a lme4 mixed model?

I use lme4 in R to fit the mixed model lmer(value~status+(1|experiment))) where value is continuous, status and experiment are factors, and I get ...
ECII's user avatar
  • 2,201
97 votes
3 answers
111k views

What is "restricted maximum likelihood" and when should it be used?

I have read in the abstract of this paper that: "The maximum likelihood (ML) procedure of Hartley aud Rao is modified by adapting a transformation from Patterson and Thompson which partitions the ...
Joe King's user avatar
  • 3,862
88 votes
3 answers
102k views

When to use generalized estimating equations vs. mixed effects models?

I have been quite happily using mixed effects models for a while now with longitudinal data. I wish I could fit AR relationships in lmer (I think I'm right that I can't do this?) but I don't think it'...
Chris Beeley's user avatar
  • 5,841
81 votes
5 answers
7k views

Unified view on shrinkage: what is the relation (if any) between Stein's paradox, ridge regression, and random effects in mixed models?

Consider the following three phenomena. Stein's paradox: given some data from multivariate normal distribution in $\mathbb R^n, \: n\ge 3$, sample mean is not a very good estimator of the true mean. ...
amoeba's user avatar
  • 106k
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
69 votes
5 answers
12k views

How exactly does a "random effects model" in econometrics relate to mixed models outside of econometrics?

I used to think that "random effects model" in econometrics corresponds to a "mixed model with random intercept" outside of econometrics, but now I am not sure. Does it? Econometrics uses terms like "...
amoeba's user avatar
  • 106k
64 votes
2 answers
68k views

What is a difference between random effects-, fixed effects- and marginal model?

I am trying to expand my knowledge of statistics. I come from a physical sciences background with a "recipe based" approach to statistical testing, where we say is it continuous, is it normally ...
N26's user avatar
  • 1,975
59 votes
2 answers
42k views

Prediction interval for lmer() mixed effects model in R

I want to get a prediction interval around a prediction from a lmer() model. I have found some discussion about this: http://rstudio-pubs-static.s3.amazonaws.com/...
hossibley's user avatar
  • 897
57 votes
2 answers
112k views

Using lmer for repeated-measures linear mixed-effect model

EDIT 2: I originally thought I needed to run a two-factor ANOVA with repeated measures on one factor, but I now think a linear mixed-effect model will work better for my data. I think I nearly know ...
phosphorelated's user avatar
51 votes
1 answer
148k views

Negative values for AIC in General Mixed Model [duplicate]

I'm trying to select the best model by the AIC in the General Mixed Model test. The best model is the model with the lowest AIC, but all my AIC's are negative! So is the biggest negative AIC the ...
Josephine van Nieuwenhuizen's user avatar
50 votes
2 answers
77k views

Mixed Effects Model with Nesting

I have data collected from an experiment organized as follows: Two sites, each with 30 trees. 15 are treated, 15 are control at each site. From each tree, we sample three pieces of the stem, and ...
Erik's user avatar
  • 555
49 votes
5 answers
93k views

Negative values for AICc (corrected Akaike Information Criterion)

I have calculated AIC and AICc to compare two general linear mixed models; The AICs are positive with model 1 having a lower AIC than model 2. However, the values for AICc are both negative (model 1 ...
Freya Harrison's user avatar
47 votes
7 answers
48k views

What is the minimum recommended number of groups for a random effects factor?

I'm using a mixed model in R (lme4) to analyze some repeated measures data. I have a response variable (fiber content of feces) ...
Chris's user avatar
  • 939
47 votes
2 answers
76k views

How can I test whether a random effect is significant?

I am trying to understand when to use a random effect and when it is unnecessary. Ive been told a rule of thumb is if you have 4 or more groups/individuals which I do (15 individual moose). Some of ...
Kerry's user avatar
  • 1,219
46 votes
3 answers
146k views

"Model failed to converge" warning in lmer()

With the following dataset, I wanted to see if the response (effect) changes with regard to sites, season, duration, and their interactions. Some online forums on statistics suggested me to go on with ...
Syamkumar. R's user avatar
46 votes
2 answers
37k views

How trustworthy are the confidence intervals for lmer objects through effects package?

Effects package provides a very fast and convenient way for plotting linear mixed effect model results obtained through lme4 ...
Mikko's user avatar
  • 1,342
45 votes
2 answers
16k views

Are mixed models useful as predictive models?

I am a bit confused about advantages of mixed models in regard to predictive modelling. Since predictive models are usually meant to predict values of previously unknown observations then it seems ...
sztal's user avatar
  • 1,191
43 votes
3 answers
38k views

What is compound symmetry in plain english?

I recently realized that a mixed-model with only subject as a random factor and the other factors as fixed factors is equivalent to an ANOVA when setting the correlational structure of the mixed model ...
Henrik's user avatar
  • 14.3k
43 votes
1 answer
38k views

What does the anova() command do with a lmer model object?

Hopefully this is a question that someone here can answer for me on the nature of decomposing sums of squares from a mixed-effects model fit with lmer (from the ...
Martyn's user avatar
  • 576
43 votes
3 answers
51k views

How do I interpret the 'correlations of fixed effects' in my glmer output?

I have the following output: ...
susie's user avatar
  • 711
42 votes
3 answers
67k views

Difference between generalized linear models & generalized linear mixed models

I am wondering what the differences are between mixed and unmixed GLMs. For instance, in SPSS the drop down menu allows users to fit either: ...
user9203's user avatar
  • 689
42 votes
8 answers
26k views

Under what conditions should one use multilevel/hierarchical analysis?

Under which conditions should someone consider using multilevel/hierarchical analysis as opposed to more basic/traditional analyses (e.g., ANOVA, OLS regression, etc.)? Are there any situations in ...
Patrick's user avatar
  • 783
40 votes
1 answer
33k views

What is the difference between generalized estimating equations and GLMM?

I'm running a GEE on 3-level unbalanced data, using a logit link. How does this differ (in terms of the conclusions I can draw and the meaning of the coefficients) from a GLM with mixed effects (GLMM)...
user avatar
40 votes
1 answer
51k views

How to interpret variance and correlation of random effects in a mixed-effects model?

I hope you all don't mind this question, but I need help interpreting output for a linear mixed effects model output I've been trying to learn to do in R. I am new to longitudinal data analysis and ...
Zeda's user avatar
  • 501
40 votes
1 answer
22k views

What are easy to interpret, goodness of fit measures for linear mixed effects models?

I am currently using the R package lme4. I am using a linear mixed effects models with random effects: ...
mjburns's user avatar
  • 1,107
39 votes
4 answers
120k views

Checking assumptions lmer/lme mixed models in R

I ran a repeated design whereby I tested 30 males and 30 females across three different tasks. I want to understand how the behaviour of males and females is different and how that depends on the task....
crazjo's user avatar
  • 878
37 votes
1 answer
79k views

predict() Function for lmer Mixed Effects Models

The problem: I have read in other posts that predict is not available for mixed effects lmer {lme4} models in [R]. I tried ...
Antoni Parellada's user avatar
37 votes
3 answers
27k views

Satterthwaite vs. Kenward-Roger approximations for the degrees of freedom in mixed models

The lmerTest package provides an anova() function for linear mixed models with optionally Satterthwaite's (default) or Kenward-...
doko's user avatar
  • 471
36 votes
6 answers
25k views

How can I include random effects (or repeated measures) into a randomForest

I'm not even sure that the question makes much sense, but I think I saw a couple of titles of papers where they proposed random forest with random effects. Is this possible in R?
mguzmann's user avatar
  • 665
36 votes
5 answers
10k views

Modelling longitudinal data where the effect of time varies in functional form between individuals

Context: Imagine you had a longitudinal study which measured a dependent variable (DV) once a week for 20 weeks on 200 participants. Although I'm interested in general, typical DVs that I'm thinking ...
Jeromy Anglim's user avatar
36 votes
1 answer
42k views

Multiple comparisons on a mixed effects model

I am trying to analyse some data using a mixed effect model. The data I collected represent the weight of some young animals of different genotype over time. I am using the approach proposed here: ...
nico's user avatar
  • 4,591
35 votes
2 answers
40k views

Why do I get zero variance of a random effect in my mixed model, despite some variation in the data?

We’ve run a mixed effects logistic regression using the following syntax; ...
Nick Riches's user avatar
35 votes
2 answers
40k views

lme and lmer comparison

I was wondering if anyone could enlighten me on the current differences between these two functions. I found the following question: How to choose nlme or lme4 R library for mixed effects models?, but ...
Hong Ooi's user avatar
  • 8,309
34 votes
3 answers
53k views

How to get an "overall" p-value and effect size for a categorical factor in a mixed model (lme4)?

I would like to get a p-value and an effect size of an independent categorical variable (with several levels) -- that is "overall" and not for each level separately, as is the normal output from ...
user3288202's user avatar
  • 1,335
34 votes
2 answers
53k views

REML or ML to compare two mixed effects models with differing fixed effects, but with the same random effect?

Background: Note: My data set and R code are included below text I wish to use AIC to compare two mixed effects models generated using the lme4 package in R. Each ...
It Figures's user avatar
33 votes
4 answers
17k views

How do I fit a multilevel model for over-dispersed poisson outcomes?

I want to fit a multilevel GLMM with a Poisson distribution (with over-dispersion) using R. At the moment I am using lme4 but I noticed that recently the ...
George Michaelides's user avatar
33 votes
1 answer
51k views

Specifying multiple (separate) random effects in lme [closed]

I was working in R packages nlme and lme4, trying to specify the models with multiple random effects. I found, that only nlme allows to specify the heterogeneous structure of the variance. Therefore, ...
Slava's user avatar
  • 891
33 votes
5 answers
124k views

How to test and avoid multicollinearity in mixed linear model?

I am currently running some mixed effect linear models. I am using the package "lme4" in R. My models take the form: ...
mjburns's user avatar
  • 1,107
33 votes
1 answer
2k views

Variance on the sum of predicted values from a mixed effect model on a timeseries

I have a mixed effect model (in fact a generalized additive mixed model) that gives me predictions for a timeseries. To counter the autocorrelation, I use a corCAR1 model, given the fact I have ...
Joris Meys's user avatar
  • 8,922

1
2 3 4 5
159