# 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.

4,220 questions
Filter by
Sorted by
Tagged with
34 views

### Is my design nested or crossed? Question concerning specifying random effects with lmer in R

I've run an experiment where 120 participants (PP) viewed 40 quotes (Item) each (presented in Facebook format) and were asked to ...
33 views

### Different linear mixed model approaches for only estimating variance components once

I found these papers on linear mixed model with a single random intercept: 1. https://www.genetics.org/content/177/1/577.long Where they use an approach for implementing a linear mixed model, where ...
34 views

### Repeated measure clinical trial Linear mixed model

I am working on a clinical trial testing an innovative rehabilitation therapy on patients and I would like some suggestions on how to analyse the data. The study design is: 2-groups: conventional (n=...
176 views

### Why not always use generalized estimating equations (GEE) instead of linear mixed models?

I read about generalized estimating equations (GEE) here, here and at other sites. It is mentioned in first of above links that "the parameter estimates are nearly identical" for linear ...
27 views

### Standard error in multi-level models vs. non-multi-level models

Gelman & Hill (pp. 252-259) discuss "no-pooling" (single-level), and "partial-pooling regression" (multi-level) with no predictor ($section~ 12.2$). In almost all mixed-effects ...
48 views

### spaMM::fitme() - error troubleshooting and application to longitudinal data [closed]

I'm trying to fit a GLMM that accounts for spatial autocorrelation (SAC) using the spaMM::fitme() function in R. I have a longitudinal data set where observations were collected repeatedly from a ...
65 views

### Does sample size affect choice between fixed and random effect

I am analyzing data as given in this question: Should "City" be a fixed or a random effect variable? Here it is debatable whether "City" is to be kept as fixed effect or random ...
24 views

...
41 views

### Which model and distribution to use to fit continuous proportional data with random effects; glmmTMB, glmer, lme? I am getting errors with all 3

I am having trouble determining the most appropriate model to fit my continuous proportional data. I am analysing the proportion of time individuals were detected within an acoustic receiver array ...
565 views

### Should “City” be a fixed or a random effect variable?

I am analyzing data on "BloodSugar" level (dependent variable) and trying to find its relation with "age", "gender" and "weight" (independent variables) of ...
41 views

### Is this correct use of linear mixed model?

This is the current data I have I want to know if fixed factor A has any effect on C. That is, if A1 = A2 = ... = A5. I think I am trying to find a group difference, correct me if I am wrong. ...
32 views

### R - Data Simulation with Multiple Random Slopes

I am trying to run the following model: I(week^2):mutation_status + (week + I(week^2) | subject_id) , data = sim_dat) This is the output I ...
32 views

### Comparing model performance: do fixed and random effect regression models give different model ranking?

I am a graduate student in animal science. I am comparing linear models that fit covariates of var1 and var2. These two covariates are decomposed from one quantity say F (inbreeding level of animal). ...
27 views

### Multilevel hierarchical simulation? What model to use?

The problem: I have a dataset that I think could be deemed hierarchical. Assume that there are 1-100 ids, which all can have anywhere from 1-3 sub_ids. Both the top ids can have specific features that ...
65 views

### Non-normality in linear mixed models/GLMM

I have some data of time-depth profiles of whales. I want to model how the maximum depth of each dive (deepest point reached during a dive) changes between two dive types, foraging (if the whale feeds)...
68 views

### Correlation of two continuous variables but with clustered data

I want to correlate two changes in time, a change in microbiota with a change in some marker. There are several time points, so I have several differences in each participant. My idea is to see if ...
46 views

### Comparing lmer and LCMM (single class) models

I am modeling the same dataset using both lmer and LCMM. My understanding is that if I use class count of 1 for LCMM, the models derived from both methods should be very similar. However, as seen in ...
147 views

### Difference between Repeated measures ANOVA, ANCOVA and Linear mixed effects model

What is the best way to analyze these data: Subjects are divided in two "Group" (Treatment A and B). "Weight" is recorded before and 3 months after treatment. Outcome variable: ...
36 views

### lme4: prevent 'glmer' to have zero estimated random coefficient

I use the glmer function with the Poisson family from lme4. My simulated data are constituted of 3600 individuals, and a ...
22 views

### Preparing **probabilities** data for mixed effect modeling

I have two related problems i cant seem to find an online solution and would really appreciate any direction. I am modeling probabilities* as a function of different predictors, across 35 subjects. X1 ...
29 views

### glmmLasso vs. lmmLasso vs. LMMEN to reduce highly correlated predictors?

I have trouble choosing the correct model and parameters for my problem. I have around 20 experts who rated the quality of brain tumor segmentations for around 20 patients on a 1 to 6 star scale. I ...
17 views

### How to model repeated measurements with the same outcome in a Bayesian framework?

Can't think of a more accurate title, so I'll illustrate the problem with an example. I want to record temperature using cheap noisy sensors. I also have recordings from a gold-standard reference ...
36 views

### Estimating a paired samples t-test equivalent in mixed model with two random factors

I have data where 880 participants answered 10 questions at time 1 and at time 2. I want to use a mixed model and consider both participants (id) and questions (question) as random effects. I'm using ...
57 views

### Follow-up: Complete-pooling, no-pooling, and partial-pooling regression in R

This great answer demonstrates the concepts of "complete-pooling regression", "no-pooling regression", and "partial-pooling regression" (3 concepts) using simulated data ...
24 views

### How to interpret main effect with two interaction terms?

I have three variables in a multilevel model: Relationship Status (0 = single, 1 = not single) Living Arrangement (0 = alone, 1 ...
41 views

### Autocorrelation in linear mixed models (lme)

To study the diving behaviour of whales, I have a dataframe where each row corresponds to a dive (id) carried out by a tagged individual (whale). For each dive I calculate a series of parameters (...
37 views

### Are priors in Bayesian inference similar to levels in mixed-effects models?

I often see a frequentist multi-level model (MLM) structure is defined like so (made up parameters): $$\theta_i \sim \mathcal{N}(10, 2.5)$$ $$y_{i,j} \sim \mathcal{N}(\theta_i, 0.5)$$ But this is ...
56 views

### Is it appropriate to consider animal ID as random effect group level for mixed model?

My gene expression data are set up as 24 animals with independent Animal.ID assigned to 3 "Status" groups (8 animals each) based on herd test results. Each status group receives Treatment or ...
14 views

### How to interpret interaction in the absence of main effect? Multilevel Modeling

What is the substantive interpretation of an interaction in the absence of a main effect? Statistically I understand that the interaction modifies the main effect, but how to interpret this from a ...
47 views

### How to deal with autocorrelation in mixed models

I am trying to model a varible (maximum depth) as a function of type of dive and diel changes (day,night) with the individuals (whales in this case) as a random factor in R. I tried first to apply a ...
47 views

### What does a p-value of exactly 0 mean - lme (nlme) function fixed effects

Using the nlme package in R, I ran a multilevel regression model model with a random intercept and a fixed linear effect of time with REML estimation: ...
38 views

### All p-values of linear mixed models equal to 0

I am trying to model a varible (maximum depth) in function of type of dive and diel changes (day,night) with the individuals (whales in this case) as random factor in R. I tried to apply a linear ...
18 views

### Outlier in random effect - GAM

Is there any advice on how to deal with outliers in a generalized additive model? I have been following the book "Generalized Additive Models : An Introduction with R, Second Edition" by ...
32 views

### Random effect structure without correlation between intercept and slope

My two models are roughly like this: Y ~ A + (C+B||participant)+(1|B) and Y ~ A + ( C+ B || participant) the difference being ...
14 views

### Visualising mixed model with only random slopes?

How can I visualize a mixed model with random slopes for a variable but no fixed effect for that variable in a simple model such as y ~ 1 + (var | subject)?
20 views

### Including a baseline covariate in a linear mixed-effects model

I have a question on modelling a big data set (about 5000 subjects). I want to model a random intercept+slope, many of the subjects have only two observations (baseline and one follow-up), but some ...
58 views

### Choosing lmer model for repeated measurements with interactions

I am modeling the longitudinal data attached below with lmer model. Time_point increases in steps of 6 months. I wish to compare Groups 2, 3 scores to group 1 in time, taking into consideration age at ...
62 views

### Doubt regarding mixed modeling format

Say, I have a dataset that looks at how many times my 5 babies chases a cat around the house . I'm trying to estimate 'y' which is the number of times the cat runs one complete round around the house ...
110 views

### Demonstrating complete-pooling, no-pooling, and partial-pooling regression in R

Gelman & Hill (pp. 255-259) demonstrate in R how to achieve a "complete-pooling regression", "no-pooling regression", and "partial-...
33 views

### A figure or narrative to compare multi-level models and fixed-effects ANOVAs

TL;DR: What figure or narrative can represent a fixed-effect ANOVA if we represent $complete~pooling$, $no~pooling$, and multi-level (partial pooling) models using the following figures (and ...
67 views

### Alternative to Mixed ANOVA without homogeneity of variances

As is tradition on these posts, I should say I'm relatively new to statistical analysis at this level so if I don't provide enough info off the bat bear with me. So I've conducted an experiment ...
34 views

### Are time points nested in students or crossed in a longitudinal multi-level model

I often hear that in a longitudinal multi-level analysis, time points (as a fixed factor) are "nested" within students (e.g., just search the word $nest$ in this paper). However, this great ...
36 views

### minimal detectable effect size in linear mixed model

I'm trying to find the minimum detectable effect size (MDES) given my sample, alpha (.05), and desired power (90%) in a linear mixed model setting. I'm using the ...
64 views

### Interpretation of coefficients in mixed-effects model with circular response?

I have a dataset from an experiment where wild ants were surveyed continuously for 24 hours under a number of temperature treatments (chambers). Whenever an ant was observed, the species of the ant ...
18 views

### How do I calculate the standard error and p value for a piecewise linear mixed model with lmer?

I have fit a piecewise spline linear mixed model with multiple knots: ...
176 views

### Linear Mixed Effect Model - random intercept and slope? Identifiability problems

I have a question regarding model building for a large dataset including about 5000 Subjects. I want to fit a LMEM including multiple variables and I have repeated measurements in time. But for some ...
16 views

### How to test “nesting effects” in a linear model after you have reduced the IV by factor analysis?

I have a couple items (let's say 10) had run in a study and I want 1) to reduce the dimensions by factor analysis. Then I have two factors (let's say factor A has 3 and factor B has 7 items). After ...
42 views

### Nested or Crossed Effects with Nationalities

I am working with mixed effects models and I am still a bit confused. While I have read multiple explanations of what the differences between nested and crossed random effects are, I am not sure how ...