Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
0 votes
0 answers
22 views

Derive gamma-parameters from preset R^2 in mixed models

For a simulation study in R, I want to select the effect sizes according to a preset $R^2$. Consider this two level random intercept mixed model, with one L1 predictor $X_{ij}$ and one L2 predictor $...
0 votes
0 answers
24 views

Multilevel Model in R

I have data from a study in which 19 participants (9 males, 10 females) have each completed 4 jumping conditions (BW, 20, 25, 30) whilst I have measured joint level data for the hip, knee and ankle. I ...
0 votes
0 answers
12 views

mice multilevel imputation: does specifying cluster variable ("-2" in predictor Matrix) without multilevel methods lead to cluster robust imputation?

In short: Are mice's imputations cluster robust when I only specify the cluster variable with "-2" in the predictor matrix but do not use multilevel models during imputation? For clustered ...
4 votes
1 answer
655 views

GLMM with time-series covariance and binary response variable?

I have a binary response variable that was measured at irregular time intervals for a number of individuals. I want to fit a GLMM that accounts for the time-series covariance within individuals. I ...
0 votes
1 answer
33 views

Mediation models require a sigma matrix that is symmetric

I'm trying to fit the following reproducible mediation model called final. But I get an error saying: sigma must be a symmetric matrix Could you please advise how ...
2 votes
1 answer
38 views

Seeking recommendations for R Packages for Multilevel Mediation Analysis with Binary Mediator

I am conducting a research study and aim to investigate the relationship between dietary habits (independent variable) and academic performance (dependent variable) of adolescents, with ...
8 votes
1 answer
471 views

Power analysis for three-level multilevel models in R

For a study in a social science setting - where huge number of participants are not easily available - I'm trying to do a power analysis for a three-level multilevel design. There are few packages ...
1 vote
1 answer
26 views

Setting predictor variables with 3-levels in multilevel mode

I am working with a random intercept multilevel modeling. I want to predict general health based on survey data. The survey uses nested data set on three levels: individual, county, and state. I am ...
2 votes
1 answer
35 views

Experimental condition with multilevel model

I am working with a survey experiment. The data is set at three levels: individual, county, and state. The experimental condition was randomized at the individual level 1. That is, some individuals in ...
0 votes
1 answer
283 views

Is standardize always necessary when predictors having very different scales?

I am running a two-level mixed model, where individual economic status and GDP per capita (PPP) are predictors, and subjective well-being (SWB) is outcome. Two predictors (economic status, PPP) are ...
1 vote
3 answers
443 views

Comparing variance in random effects: crossed random effects or different models?

I am interested in making sure that a predictor I include into a regression actually explains the type of variance it should. To be more specific: in an experiment in which a number of people sees a ...
1 vote
0 answers
210 views

Analysis of incomplete block design and block-level attributes

I am working in a system where experimental treatments are necessarily associated with specific blocks (a complete design is not possible) and am looking for guidance on valid model specification. ...
2 votes
0 answers
39 views

Can I Perform a Micro Synthetic Control Analysis with Different Aggregation Levels for Treatment and Control Groups?

I am conducting an analysis using the microsynth package in R to evaluate the impact of increased police presence on various outcome measures obtained from an official survey. My treatment areas ...
1 vote
0 answers
56 views

Error in lmerTest: The random-effects parameters and the residual variance (or scale parameter) are probably unidentifiable

I know that there have been similar questions before, but I dont still get it. I would like to estimate a multilevel model with repeated measures in R using the package “lmerTest”. The model ...
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 ...
0 votes
1 answer
281 views

R: Inflated degrees of freedom in mixed linear model

I have a question regarding a mixed model I am using: In a study, participants have been presented with 40 different news article headlines and indicated for each headline whether they would share the ...
3 votes
1 answer
48 views

Mixed Model: Translation from mathematical notation to R's lmer() - package: lmerTest

The following data should be generated and fitted to a mixed model (for further simulation studies): $y$: outcome of clinical study (effect of medication) indiv individuals = 20 repl replicate ...
1 vote
1 answer
781 views

Specification of longitudinal mixed-effects model with varying treatment times, varying observation times in lme4

I am familiar with fixed-effects linear regression models, and have done reading on mixed-effects models. I am attempting to fit a model based on observational data, where treatments come at varying ...
1 vote
2 answers
743 views

Cross-level correlations in a Multilevel Model

I'm currently running a daily diary study, where participants first complete a baseline survey and then complete the same survey each day for 10 days. My data has a nested structure (days nested ...
0 votes
1 answer
48 views

Estimating a (purposely) misspecified multilevel model in R using frequentist statistics with MCMC/BS and getting cluster-specific effects and CIs

Dear Stackoverflow friends, I have a challenging task. I am trying to purposely (for research/teaching) estimate a misspecified multilevel model and retrieve its cluster-specific estimates and CIs ...
1 vote
1 answer
162 views

Can Lavaan handle multigroup multilevel SEM?

I am wondering if it is possible to run a multigroup, multilevel SEM in Lavaan. I can run the analysis just as a multigroup and just as a multilevel, but when I try to specify both cluster and group, ...
6 votes
3 answers
11k views

Creating ROC curve for multi-level logistic regression model in R

I used the functions from this link for creating ROC curve for logistic regression model. Since the object produced by glmer in ...
4 votes
2 answers
252 views

Mixed Model for Repeated Measurement (mmrm) - Assumptions

I want to fit a mixed model for repeated measures (mmrm) on a set of panel data with 6 visits and N = 1200. I want to estimate the effect of time passing on the outcome, without any intervention since ...
0 votes
1 answer
44 views

Multi-level Linear Mixed Model: Sampling and Power Issues

I am struggling to find a proper model for my analysis, and on top of this, I have some questions about the number of observations and the resulting power of the model. Experiment I ran a reaction ...
1 vote
2 answers
387 views

Running a multilevel model without level-1 predictors

Is it acceptable (publishable) to run a multilevel model with only level-2 and level-3 predictors? Example: Looking only at the effect of school resources, size or location, and at the district level (...
5 votes
2 answers
276 views

Clarification on Random Effects Structure in Linear Mixed Models in R

I am using linear mixed models to analyze a dataset with a hierarchical structure, where measurements over time (level 1) are clustered within individuals (level 2), and individuals are clustered ...
2 votes
1 answer
133 views

Why estimated population variance differs from estimated $\sigma^2 + \tau^2$ in this random effects ANOVA?

A random effects ANOVA model is typically written as $Y_{ij} = \gamma_{00} + u_{0j} + \epsilon_{ij}$ . and the total variance of the outcome variable is decomposed into $var(Y_{ij}) = \tau^2 + \sigma^...
1 vote
0 answers
69 views

Bread freshness in bread basket, Multi-Level Analysis in R; 2 time points [closed]

This is my first attempt with multi-level analysis. My research question is; How does the freshness of different types of bread (6 level) within a bread basket, change over two time points (ranging 4-...
0 votes
0 answers
30 views

Is it appropriate to calculate odds ratios from random effects glmm output?

Is it appropriate to calculate odds ratios from random effects glmm output? about the data: grown (binary): whether flower grows over a certain height (TRUE/FALSE)...
user avatar
3 votes
1 answer
111 views

How to fit random slope hierarchical model as SEM with OpenMx in R?

I've been exploring the OpenMx Package in R in hopes to fit multilevel path analysis and I can't figure out how to add random slope. This is the model I am trying to fit: $$ Y_{ij} = \beta_{0j} + \...
1 vote
1 answer
55 views

Understanding lme4 output: Unexpected different results [closed]

I am teaching myself how to do multi-level models (MLMs) in R. I have two models, which I think should give me the same information (with some omissions in M2), but they are not completely the same. I ...
2 votes
0 answers
33 views

How to fit a GLMM with multiple levels of nesting

I have some data I am struggling to process at the moment. I have landed on using generalized linear mixed models (GLMMs), but I am having a very hard time wrapping my head around it. I have a large ...
3 votes
0 answers
18 views

How to nest multilevel model (or to nest at all)?

I'm trying to handle some data and get some insights from it. The data includes a binary outcome variable, so I am using glmer. The relationship is whether age groups are more likely to engage in the ...
0 votes
1 answer
44 views

Random effect variance with or without fixed-effects intercept

I'm fitting some hierarchical models in R using lmer, and am trying to understand why the results change as they do when I either include or exclude a fixed-effects ...
1 vote
0 answers
45 views

Understanding equatiomatic output

I have fit a lmer model as follows: ...
3 votes
1 answer
614 views

How to add interaction and covariates to linear mixed effects model in R

I have some data ($x$ and $y$) collected over multiple days for multiple people. I want to test whether the contemporaneous associations between $x$ and $y$ (measured daily) is stronger depending on ...
1 vote
0 answers
276 views

How to perform multilevel moderated mediation analysis with {mediate}

I'm attempted to run a multilevel moderated mediation analysis in R using the mediate package. Some details on my sample: I have an experimentally manipulated ...
0 votes
0 answers
98 views

Conducting a moderated multilevel mediation with more than two levels in R

I'm trying to conduct a moderated multilevel mediation model in R, but I'm still a pretty junior graduate student and I've only ever done mediation with lavaan. My outcome variable is cortisol, for ...
2 votes
2 answers
214 views

Mixed-effects model of nested time series [closed]

I have time series data for a variable from different climate models, each with multiple runs using different initial conditions (ensemble members). A small subset of the data to see how its laid out (...
2 votes
0 answers
60 views

Why predicted values differ among methods?

I am using the dataset Orthodont from nlme to simplify my example. ...
4 votes
1 answer
123 views

What it means to model the residuals of a multilevel model?

I have a highly skewed dataset. But, my MODEL of choice below shows drastically improved, normally distributed residuals (and predicted values) compared to other models whose residuals are not modeled....
0 votes
0 answers
78 views

Calculate the average marginal effect (AME) in the multilevel regression with glmmTMB package

I am writing this message because I want to calculate the average marginal effects (AME) in order to be able to interpret an interaction resulting from a multilevel regression. However, I am finding ...
1 vote
1 answer
65 views

Modelling 3-level MLM of longitudinal data in R

I have two questions regarding modeling a 3-level multilevel model in R. I have a dataset of different variables that were assessed 4x as part of a longitudinal study. At each of the four assessments ...
2 votes
1 answer
80 views

Interpretation of random effects in mixed model with glmer()

I'm working on a final project and need to estimate a multilevel logistic model for analyzing dropout rates in higher education in a specific region. The model has three levels, where intercepts vary ...
5 votes
1 answer
2k views

What is the difference between mixed-effects modelling in the RStan and lme4 packages?

I've recently begun running some multilevel/hierarchical models. Initially I was using rstan/rstanarm, but then switched to the lme4 package. Is the difference between these two packages only in the ...
2 votes
1 answer
5k views

PowerSim function (simr package) indicates 100% power for small sample dataset, regardless of effect size, alpha level, or if fixed/random slopes

I am using the simr package to do power analyses for lmer multilevel models I have run, to determine the power of a pilot dataset for future research. The dataset consists of 46 subjects with ...
1 vote
1 answer
374 views

Repeated measures with nested data in R

Previously, I conducted a model like the following. I have repeated measures (Time factor: pre-post) of depressive mood in two different groups (Group factor: neutral and experimental). Each ...
1 vote
0 answers
876 views

plm vs lmer - differences in outputs?

I am looking to run a random-effects model to look at attainment of pupils who are nested within schools. The model specification includes pupil-level characteristics, school-level characteristics and ...
0 votes
0 answers
22 views

High Type 1 Errors in Power Analysis by Simulation for Null Effect with Multilevel Ordinal Regression with Cumulative Link Model

I am doing a power analysis for an experiment where we will fit a cumulative link model for ordinal regression. But when I do the power analysis, my power for the null effect is between 20% and 30%. ...
-1 votes
1 answer
2k views

Hierarchical logistic regression package in R

I'm working on a logistic regression model; the purpose of the analysis is to identify factors that influence use of an app - the DV being use/no use, and IVs being a couple of numerical and ...

1
2 3 4 5
10