Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
0answers
8 views

Simulating data with nested random effects

I would like to simulate nested data, where my mixed effects model fitted to real data has the form: y ~ time + (1 | site/subject) I then take the hyper-...
0
votes
0answers
6 views

Repeated measures mixed model correlation between measurements

I am interested in looking at the correlation between two types of heart function measurements over time. test1 can be considered the true value. The true value (<...
0
votes
0answers
9 views

Impute and Transform using mice? [on hold]

I have a 3-level simulated dataset with missing values in the predictor variables measured at the lowest level- Xijk. I want to impute these missing values and calculate aggregate measures using ...
0
votes
0answers
24 views

Implementation of REML estimation with observation weights

Given a diagonal weight matrix $W$, a standard implementation of weighted regression in OLS is to multiply both the design matrix $X$ and the response vector $Y$ by the square root of weights and then ...
0
votes
0answers
15 views

Visit level variables along with merchant level variables

I am using mixed model and my dependent variable is conversion. Records are at visit level. I have merchants selling different products in the data set, and each merchant has attributes: merchant name,...
0
votes
1answer
20 views

How to include nested data in a mixed-effects model using R?

I am analyzing data from bird foraging surveys using the lme4 package in R and I am interested in the effects of field size (area), among other variables, on swallow rate of use. The surveys took ...
0
votes
0answers
26 views

repeated measure correlations and linear mixed effect models

I have $N_r$ repeated measures of four continuous variables $A_{ij}$, $B_{ij}$, $C_{ij}$, $D_{ij}$, $i=1, \ldots, N_r$, for each subject $j = 1, \ldots, N_s$. The repeated measures within each subject ...
0
votes
1answer
35 views
0
votes
0answers
14 views

Identifying influential data points (not necessarily outliers) for a LMER model

I am looking for a good way to identify influential data points in a mixed effect model with interaction (since these are NOT necessary outliers). (1) Is there any good function to do that? How would ...
1
vote
1answer
22 views

emmeans pairwise contrasts result in same output values for all?

First of all, I am a beginner at mixed models, so I beg your patience and advice if this post could be improved. The structure of the data: ...
0
votes
1answer
28 views

dependent variable on logarithmic scale, can treat as linear?

I have a dependent variable on a logarithmic scale, specifically, it is loudness measured in dB. I am using a mixed effects model since I have a longitudinal data structure. Is a linear mixed effects ...
1
vote
1answer
40 views

mixed effects model in repeated measurements

My question is conceptual. Suppose $n$ patients, where each one is measured at 4 different time points. The outcome is continuous. The patients are randomly assigned to two groups, intervention yes/no....
0
votes
1answer
23 views

Specify nested random effects [closed]

I have data from a field survey. The objective of the study is to relate number of seedling (respond variable, count data), flood duration (exploratory variable, categorical variable with 3 levels) ...
0
votes
0answers
25 views

literature about permutation tests in linear mixed models to test fixed effects of categoircal variables under the null hypotheses

I'm currently analyzing a linear mixed model to model the effect of different treatments (two factors, both within and with multiple categories, e.g. treatment1_1, treatmen1_2, treatmen1_3, Treatment ...
0
votes
1answer
51 views

All mixed effects coefficients are incorrectly positive in lmer lme4

I have data from a simple intervention design (n=500), where participants were measured across a number of (continuous) outcome variables at pre- and post-intervention (there was no control - not my ...
0
votes
0answers
18 views

What does effect size of a lme4 model mean?

I have fitted an LMM with interaction of four variables (within and between subject design). I was looking for a good way to estimate the effect size of particular interactions (still looking!) when ...
0
votes
1answer
45 views

Confusing main effect in mixed design ANOVA

I am conducting a mixed design ANOVA test using ezANOVA. I ran two different tests as follows: Test1: within subject variable w, between subject variables age and x1. Test2: within subject variable ...
0
votes
2answers
47 views

Calculating covariance and ICC in mixed models?

I'm a bit confused on how to start calculating by hand the covariance and intraclass correlations for mixed effects models. For example, in the particular example below: $$ y_{ijk} = \beta'\...
0
votes
1answer
24 views
1
vote
1answer
30 views
0
votes
0answers
17 views

How to calculate the between subject variability (BSV) of X if I know the BSV of sqrt(X) or lnX?

I know that if one has estimate of between subject variability (BSV, a random effect) for Ln(X), one can compute BSV of X using the formula: intersubject co-efficient of variation (CV) = sqrt(exp(...
1
vote
1answer
15 views

Specifying random slope in a nested model

I am super confused on mixed models now. Can anyone explain me what does the following imply: mod <- lmer(yield ~ year + (1|country/region/state), data = temp) ...
1
vote
1answer
46 views

single measure of a fixed factor for each level of a random effect

I have a population animals, and am looking at the effect of (yearly) environmental temperature on date of birth and litter size. Births in the population have been monitored for 15 years (one litter ...
0
votes
1answer
34 views

Mixed desgin ANOVA or LMM?

I am hitting a wall and would appreciate some help. Here is my data (raw data, before computing the means): ...
1
vote
1answer
19 views

Can delta method be applied for determining the between subject variability (random variance) of a function of X?

Say, for example, I square root transformed X such that it follows normal distribution, fitted a linear mixed effects model and obtained between subject variability (BSV) of sqrt(X). How do I now ...
0
votes
1answer
17 views

Equation for GLMM w crossed random effects and logit link function

I am working on a GLMM model with crossed random effects and I would like to write an equation from the output where the outcome is the probability rather than a log of the odds. ...
1
vote
1answer
26 views

Specifying random slope in a nested random effects

I collected crop yield and rainfall data from multiple counties and year ( > 30 years). Each county can only belong to one province and each province can only belong to one region. I am interested in ...
0
votes
0answers
7 views

mixed logit estimation in R gmnl

I want to estimate the random parameters logit model with 2 transport mode alternatives taking into account only the total cost (log-normal) and total time (normal) of the trip in R gmnl, and then ...
0
votes
1answer
23 views

generalized linear models two within-subjects factors

I have two within-subjects factors A and B. Each participant undergoes all combinations of A and B. Now I am interested whether A or B or their combination can explain my DV (C) which is coded 0 and 1....
0
votes
1answer
27 views

Linear Mixed Model in R: Rep. Measures, Nested, Random Effects

I ran a study with the following design: Subjects were presented 100 different stimuli and asked to indicate their liking (scaled from 0-10) for each stimulus. Each stimulus was part of only one of 4 ...
0
votes
0answers
13 views

Pretest - posttest design - Aggregating several variables who measure the same construct but related to different targets

This question relates to a group-randomized pre-posttest design where a group of supervisors underwent a leadership training. One of the hypothesized outcomes was that subordinate leadership ...
1
vote
1answer
35 views

Nested mixed model with longitudinal data and variables with very few observations

I am doing my first data analysis and I have a hard time translating the experiment design to the model I want to fit. I have a couple of basic questions about the overall coding of the model, and a ...
0
votes
1answer
28 views

Multilevel models - Which level should the random effects enter on?

I am currently studying the effect that a pollutant has on plant growth. The plants come from a few different regions, and it is assumed that plants from the same region share more in common than ...
0
votes
0answers
18 views

Linear mixed-effect model set up for non-repeated measures time series

I have the following experimental setup: A: 3 different treatments: Low, Mid, High concentration of toxin B: 27 identical plants, 9 randomly assigned plants to each treatment C: At days 1, 2 and 3 ...
1
vote
1answer
15 views

Is it possible to write simultaneous score equations for a linear mixed model for the fixed effect, random effect, and variance terms?

I have been learning about LMMs primarily using this resource: https://www.sciencedirect.com/science/article/pii/S002437951100320X In terms of obtaining score equations in this context, it looks ...
2
votes
1answer
54 views

Interpretting Standard Deviation of Random Effects in Sequential Mixed Effects Models

I am trying to ensure that my understanding of the random effects in Mixed Effects Models is correct, so I would like to share some R code and the standard deviations in the estimate of the random ...
0
votes
1answer
17 views

mixed model specification for nested variables

I have collected crop yield data from multiple blocks for multiple years and associated rainfall data. Each block is located within a municipality and each municipality is located within a State. I am ...
0
votes
1answer
17 views

Seemingly identical variables behaving differently in lme4 binomial model

I have a binomial mixed effects model that was fitted as follows: ...
1
vote
1answer
22 views

Why does PQL vs MCMLEs optimisation give wildly different variance estimates?

In order to better understand modelling GLMM's using R I decided to re-do the example given in this Introduction to GLMM Package using the salamander dataset (provided in the glmm package). The ...
0
votes
0answers
41 views

Effect size for linear mixed effect model

I am comparing two linear mixed effect models (lme) in R using the lme4 package, that differ in the presence of predictor (a categorical factor indicating a group membership) to see if this predictor ...
2
votes
0answers
30 views

Order random effects are entered into the model affects estimates [migrated]

In a linear mixed model setting, the order I enter my variables into the model (both as random effects and as fixed effects) seemingly affects the estimates I get from the model. In an OLS setting ...
2
votes
1answer
51 views

Why are effect size estimates difficult in mixed-effects models?

I have been reading a lot online about estimating standardised effect sizes in mixed effects models and it seems like there are formidable challenges even for something relatively broad like an R^2, ...
1
vote
0answers
32 views

Classical Cohen's d effect sizes within mixed-effects models

I am trying to get a passable effect size estimate of group differences in slope from a trend analysis, run by specifying custom polynomial contrasts within a factorial mixed-effects model. This blog-...
0
votes
0answers
14 views

Small sample size using proc mixed and can't include treatment and visit interaction term

I'm analyzing data from 2 treatment groups with repeated collections at month 1, 2, 3, 4, 5 and 6. I'm interested in the treatment difference at month 6 (e.g., using the LSMEANS statement in SAS). ...
1
vote
0answers
11 views

Deconvoluting an ECDF via mixed modeling

I have data with measurement error, $W_i$, with the following structure: $$W_i = \mu + \gamma_i + U_i$$ where $U_i \sim N(0, \sigma^2_i)$, with known $\sigma^2_i$, and $U_i \; \amalg \; \gamma_i$. I ...
0
votes
1answer
40 views

Including covariates in a mixed model (lmer)

I would like to know if there is a significant effect of condition on Score1, and how closely correlated Score2 is at approximating Score1, for the following dataset: I am using a random intercept ...
1
vote
1answer
21 views

Log response ratio of means not agreeing with linear mixed model output

I have a linear mixed model structured like so: Richness~Time*Treatment+(1|Site) Time has two levels (Pre and Post) as does Treatment (Treatment and Control). ...
2
votes
2answers
34 views

Stating the same mixed random intercept and slope model in lme as stated in lmer, and random intercept/slope equations in lmer

I have two Q's Q1: I have a mixed model that I stated in lmer(), but now I want to use lme() because I need to incorporate a correlation structure. I can see that the following models are the same ...