All Questions
Tagged with multilevel-analysis r
472 questions
5
votes
3
answers
702
views
Can fixed-effects become biased due to random structure misspecification
I'm following-up on this great answer. Essentially, I was wondering how could misspecification of random-effects bias the estimates of fixed-effects?
So, can the same set of fixed-effect coefficients ...
3
votes
1
answer
433
views
Does the interpretation of fixed effects depend on random-effects specification? (example provided)
Imagine a dataset where there are 3 nested grouping variables: study $>$ group $>$ ...
4
votes
1
answer
114
views
Types of correlations between two observations when random effects are crossed
On page 378 of Raudenbush & Bryk's (2002) book, they recognize 3 possible types of correlations among two observations given two (fully or partially) crossed random effects (i.e., neighborhood &...
4
votes
1
answer
678
views
Adding a random effect for a categorical variable
I'm following up on this great answer. Given the structure of my data (below), is it possible to add a random-effect for H (a cluster ID variable) and ...
0
votes
1
answer
146
views
Determining when groups differ in repeated measures linear mixed model
I have two groups of individuals, each individual has a score measured multiple times and I have constructed a mixed model as follows with both individual slopes and intercepts allowed to vary:
...
0
votes
0
answers
26
views
Repeated measure multilevel regression model
I have to test for correlation between Thermal inertia (TI) and Depth diameter ratio(d/D), Rim irregularity(RI), Radii variation(RV), mantled rim percentage(MRP). I want to see which variable (RI, RV,...
3
votes
1
answer
62
views
Intercept in mixed model with multiple multilevel factors
I am using a mixed model to predict the effect of certain environmental exposures on brain region measures. So temp[, j] gives the brain region our regressor and <...
0
votes
2
answers
3k
views
Mediation with multilevel data in R with lavaan
I am familiarizing myself with SEM and the lavaan package for R bc I would like to run a mediation analysis. My problem is that the data I have is nested and currently I don't see how I could do a ...
1
vote
0
answers
658
views
Fixed effect in linear mixed model becomes non-significant when model is reduced
I set up a linear mixed effects model with lme4 to test an interaction of two fixed effects condition1 and condition2 both with 2 levels and both manipulated within persons and items. In the study, ...
5
votes
0
answers
250
views
Calculating ICC for a beta-binomial GLMM
I understand that ICC in binomial GLMMs with a logit link can be calculated via R, where the residual deviance is (pi ^ 2) / 3. However, this is assuming that the ...
1
vote
1
answer
294
views
Linear hypothesis test for multivariate linear model (`mlm` object) in R
I'm running a mulivariate linear model like this one:
...
1
vote
1
answer
398
views
Multilevel (nested) model with paired data
I am new to multilevel models and I have the following experimental design:
I have 3 treatments. For each treatment, a group of families that have twins are taken. Some measure, for example height, ...
2
votes
0
answers
350
views
GLMM model formulation with a partial "subcondition"
I am modeling reaction times in a GLMM using the lme4 package. My data have the following structure:
Subject ID
Reaction times (RT)
Distractor type (Type): (3 levels): moving - static - no distractor
...
2
votes
1
answer
192
views
Between-subject design - eye-tracking data - is my model correctly specified in lmer?
I’m struggling to figure out the right model specification for eye-tracking data.
The design is a repeated measures with between-subject factors ‘visual-world’ eye-tracking study:
Two types of ...
3
votes
1
answer
1k
views
How to calculate "by hand" between group variance and the ICC for a three-level hierarchical model?
Introduction:
This question is related to this and this questions that were answered before, but I would like a more detailed answer on how between-groups variance are calculated in a (null) three-...
2
votes
0
answers
56
views
Can a grouping variable also be a predictor or vice versa
I sometimes see that a grouping variable such as study ($1,2,...15$) is used as a grouping variable to the right of the |:
...
0
votes
1
answer
495
views
Hierarchical circular-circular regression in R
I have two circular variables and I want to see if they're correlated.
The data comes from a hierarchical and unbalanced experimental design: each participant provided multiple responses and there's ...
1
vote
0
answers
32
views
multilevel regression model for nested data?
Hypothesis 1
Independent variable = Thermal inertia (TI)
Dependent variable = Depth diameter ratio (d/D), Radii variation (RV) and Rim irregularity (RI).
Hypothesis 2
Independent variable = Thermal ...
1
vote
0
answers
51
views
two levels spatial regression in r
I need help to find the proper approach in R for an analysis of data. I have measures of a variable Y for various individuals, distributed in various geographical ...
4
votes
1
answer
34
views
Asses significance in parameter differences in a multilevel model
lets say I have a model hierarchical model. 15 Observation per Individual which are allocated in one of three Condition.
Observation| Individual | Condition
I have a single independent variable (IV) ...
4
votes
1
answer
46
views
Manually dummy-coded variable works but its factor version fails in a mixed model
In my dataset, I have created two variables from a binary factor called name. Specifically ...
3
votes
1
answer
653
views
Defining the model syntax of an lme() model based on an nlme() model
I'm trying to replicate the output of mg4.math.nlme model fit via nlme() function, using the ...
0
votes
1
answer
40
views
Test score Variable interpretation in Brandsma data (mice package)
I am currently working with the Brandsma data of the mice package in R for teaching purposes.
The dataset is from Snijders&Bosker(2012), or rather Brandsma&Knuver(1989) and Knuver&Brandsma(...
1
vote
1
answer
39
views
Multi-level regression interpretation: questio of statistical significance
I am running (multi-level) logit models on hospital data testing whether the ratio two hospital tariffs has any effect on the probability of being admitted to the hospital.
My models are the following:...
0
votes
0
answers
192
views
Can we use macro variable (e.g.gdp_growth) in a panel data?
I am examining one country over a period of 10 years. I am interested to see whether GDP_growth had a heterogeneous effect on wages across people with different educational background. The code below ...
3
votes
2
answers
3k
views
Using a variable both as fixed and random effect (a fundamental question)
Sometime I hear people talk about whether to take a variable both as fixed and random effect or not (e.g., this blogpost) in the context of frequentist mixed-effects models.
According to this part of ...
1
vote
0
answers
42
views
(How) Are lme4 mixed models hierarchical?
This is a very basic/stupid question, but it's even more stupid not to ask.
Are multilevel models defined using lme4 hierarchical? (say:)
...
1
vote
0
answers
270
views
Probing 3-Way MLM Interactions in R [closed]
I have a significant 3-way multilevel model interaction with the lmer package in r. When I probe this interaction using the online tool from Preacher, then interaction has regions of significance. In ...
3
votes
1
answer
59
views
A basic question regarding mixed-models (study design and code provided)
Maybe this is too simple a question, but imagine in a 3-wave, longitudinal study, two therapists both get to deliver the treatment and the control arms of the study ...
2
votes
1
answer
80
views
Justifying terms taken as random at different levels in a mixed-model in R (study design and code provided)
I'm following up on this question. In short, imagine in a 3-wave, longitudinal study, two therapists both get to deliver the treatment and the control arms of the study to a different set of subjects (...
2
votes
1
answer
99
views
Follow-up: Random & Crossed Random-Effects in Model Syntax in R (lme4)
I'm following up on this question and this answer. The answer mentions that without having a clear study design, understanding whether the random-effects specified in an ...
3
votes
1
answer
107
views
Detecting Random & Crossed Random-Effects from Model Syntax in R (lme4)
I'm following-up on this question, and inspired by this great answer. I have 3 lme4 longitudinal mixed-models. Throughout, y is ...
0
votes
0
answers
317
views
Mixed Effects Poisson Regression with Nesting?
I have collected data for a study that had the following design:
Subjects walked through a food pantry five different days during one of two conditions: signs-down (no signs displayed, 2 days) and ...
2
votes
2
answers
456
views
Help me build a linear mixed model in R using this structure
My study looked at measuring virus titres in leaves over time. I took repeated samples from 10 subject plants. Sampling was repeated on 4 dates. Leaf sampling was done at 3 spaced loci up shoots (...
1
vote
1
answer
2k
views
How do I interpret these beta estimates in a multilevel-model?
For my undergrad thesis, I am currently trying to build a multilevel-model with two levels but I'm having a hard time as none of my courses prepared me for this kind of modeling. My main problem is ...
0
votes
1
answer
3k
views
Residual diagnostics in DHARMa for multilevel logistic regression
I'm running a multilevel logistic regression, and have been trying to look at residual diagnostics using the DHARMa package. My data is copy-pastable from here and the following code should run ...
1
vote
1
answer
64
views
Suggestions for repeated measures multilevel mixed model?
I'd like to model the variation in type-token ratio (TTR) of texts written by the same person over time. It seems reasonable to me to treat this as a repeated measures mixed model. What I want to test ...
3
votes
1
answer
128
views
R lmer4 package multilevel model adding random effect with 0 notation
I do not understand what the difference between these two models is ( I am using the lmer4 package)
...
0
votes
1
answer
901
views
How can I get the confidence interval of hierarchical forecasts reconciled with hts::combinef?
I have hierarchical data that I want to forecast, reconcile, and then plot each model's forecast.
UPDATE: In my attempt to make a minimum reproducible example I made it too simple and didnt really ask ...
1
vote
1
answer
170
views
Negative variance component despite positively constraining
Is it peculiar for variance estimate to be negative despite placing positive constraint in optimization ? Here is an example case that I just encountered. I have marked the random effect estimate with ...
8
votes
1
answer
443
views
How can a cross-level interaction be random in a 2-level mixed-model?
I was wondering why m below is a legitimate model? If it is, what is the meaning of its random part?
ses is a level-1 predictor ...
5
votes
1
answer
1k
views
Visualizing the folly of fitting random slopes for variables that don't vary within groups
Sometime I encounter wrong mixed-models that run without warning. By wrong, I mean logically nearly impossible. Think of a cross-level interaction that is set by the software syntax to AGAIN vary ...
3
votes
1
answer
78
views
Specifying the random part of a mixed-model in R
Suppose ses is a level-1 predictor of students math score, and sector is a ...
2
votes
1
answer
653
views
ANOVA represenation of mixed model with crossed random effects and uncorrelated variance structure
I was expecting this to be simple when I started, it seems to not be the case.
I am trying to model yield of bean genotypes. There were only 6 genotypes included. 3 trials were carried out in separate ...
3
votes
1
answer
694
views
Can I use bottom up, middle out, or top down approaches with fabletools:reconcile?
I have been learning how to use the very handy fable package (along with forecast, fabletools, etc.) and I have looked at fpp2 and fpp3 in the processes. fpp2 chapter 10 talks about hierarchical ...
3
votes
1
answer
46
views
Mixed-effect coefficients at nonexistent levels
Suppose I recorded successes and failures for two different conditions organized into two different blocks. However, one of the conditions (Trt) was just in first ...
2
votes
0
answers
446
views
Multi-level repeated-measures logistic regression in python/R
Accidentally posted this in stackoverflow, so reposting here. I have a repeated-measures design experiment. Each subject took part in some experimental conditions, each one associated with several ...
3
votes
1
answer
152
views
Adding level 1 time-varying predictor makes mixed effects model non-linear
I am new to mixed effects modelling and I am trying to predict depression from physical activity using mixed effects modelling / multi-level modelling. The data consists of timepoints in months (7 ...
2
votes
1
answer
602
views
Visualizing a multilevel model for others
I'm trying to draw an accurate visualization for my multi-level model below.
For the most part, I like my visualization expect one thing.
Question: How can I appropriately visualize $\gamma_{11}$ in ...
0
votes
0
answers
47
views
Multilevel model for change- time-varying variables at different waves to outcome
I am using UKHLS youth survey where an outcome for wellbeing occurs at waves 2,4,6 and 8.
I have predictors such as computer screen usage and many others I would like to use occurring at waves 1,3,5,7....