Questions tagged [multilevel-analysis]

Statistical methods appropriate for the analysis of data sets comprising several levels of hierarchy of units of analysis (e.g., students nested in classes nested in schools; observations nested in patients nested in hospitals). If you can refer to more specific models like mixed-model or glmm, please do so.

Overview

"Multilevel analysis is a general term referring to statistical methods appropriate for the analysis of data sets comprising several types of unit of analysis. The levels in the multilevel analysis are another name for the different types of unit of analysis. Each level of analysis will correspond to a population, so that multilevel studies will refer to several populations..."

-T.A.B. Snijders, Multilevel Analysis, p. 673-677 in M. Lewis-Beck, A.E. Bryman, and T.F. Liao (eds.), The SAGE Encyclopedia of Social Science Research Methods (Volume II). Sage, 2003.

Related tags

  • for linear multilevel models, or HLMs
  • for models with random intercepts
  • for models with random intercepts and slopes
  • for generalized linear mixed models (binary, ordinal, count response)
  • and for R implementations
  • for Stata implementation
  • for Bayesian models comprising several levels of hierarchy of priors and hyperpriors

Please use these tags to make your question more specific and easier to find.

164 questions
0
votes
1 answer

Residual plot by categorical independent variable only provides residuals for some categories

Apologies in advance if I haven't formatted this correctly, this is my first question on SO. I have run a series of multilevel models using lme4 in R. My outcome variables are continuous and I have one categorical level-two predictor variable with…
0
votes
1 answer

Graph legend in R shows too much data

I'm plotting a cross-level interaction, but the legend shows all of the scores, independently, instead of in a ranged colored scale, as the ones we usually find in heatmaps. How can I get the information from my clustering variable 'w' to show in a…
0
votes
0 answers

How does R understand a multi level model?

I'm new to MLM both in R and in general. I have a dataset of Building permits for a couple of cities and I have created a variable counting the number of parcels with a permit. Now, I want to perform a MLM to see if there is a census tract (a…
Kawi
  • 19
  • 5
0
votes
0 answers

Unable to plot manual line using ggplot in multilevel model

I am relatively new to R and obviously not very experienced. However, I used multilevel modeling to identify influences of voice on sleep parameters. E.g. TST in this snippet is total sleep time, intensity is voice intensity (in this case as mean).…
0
votes
1 answer

How can I solve the random effects and residual variance error using the lme4 package in R?

I am trying to analyze some simulated data (long data format) of 199 participants using the lme4 package. In this dataset, belongingness, authenticity, and inclusion are measured two times and are predicted by exercise condition (= 0, 1, 2), Time (=…
0
votes
0 answers

singular fit in one simple model but not in another using lmer R

I'm running a multilevel model using lmerTest in which employees are nested in teams and departments. I'm taking a model comparison approach, so I'm building the model with just the random effects. Here are the results when I use the two random…
J.Sabree
  • 2,280
  • 19
  • 48
0
votes
1 answer

Categorical variable coding with 0s and 1s giving different outputs in R

What I did: I did a linear mixed effect model analysis in R with nlme library. I have a categorical fixed variable, Blurriness, with 2 levels: B standing for Blurred, N standing for Non-Blurred. Upon suggestion, I changed them into, 1(for B) and…
Yesim
  • 193
  • 1
  • 1
  • 7
0
votes
0 answers

R plot combined levels of a factor (ggpredict)

I am using the function ggpredict to display a lmer model's result. The model has a continuous X (RT), one continuous Y (RC1) and 4 discrete factors (2x2x2x14). Model: SailorJupiter <- lmer(RT~RC1*m2*m3*m5*m4 + (1|Trial:sonTrial) + (1|Subject) +…
c_R
  • 23
  • 3
0
votes
1 answer

Looping over variables for multilevel regression produces type error

I am writing a multilevel regression model, in which I begin the second level with a dataframe of predictands (coefficients from the first level) and a dataframe of predictors. Both dataframes have the same number of observations. I wish to loop…
Ronny Efronny
  • 1,148
  • 9
  • 28
0
votes
0 answers

Between Subject Design with multiple Trials per participant

Between the subject experiment with two groups: Each group has a pair of 10 participants. (Player 1 and Player 2) Pairs in both groups play a game where one factor is manipulated. Hypothesis: The score of group A is higher than Group B. Can I use…
0
votes
1 answer

"Error in z0 * u[index_clus, 1:NR, drop = FALSE] : non-conformable arrays" Error when running mice with 2l.pmm method

I am trying to perform multiple imputation on a dataset with cross-classified nesting (i.e., data are nested within two different grouping variables that are not nested within each other; group1 and group2 in the code below). To account for the…
0
votes
0 answers

How to run ANOVA/multifactor regression with unequal sample size R

I am new to R, and I unfortunately don't have a nice, simple dataset. I am trying to figure out how to set up my data and code so that it will give me a way to run a comparison on the following: Experiment type factor levels ("Experiment"):…
FlyGuy
  • 1
  • 3
0
votes
1 answer

How to convert a wide data into long format for cross-classified model [R, GLMM]

I would like to convert wide data to long data in R, and my data set is for cross-classified models, exploring participants’ response to each target item that has different characteristics. condition is one of the two conditions where…
user8460166
  • 73
  • 1
  • 6
  • 24
0
votes
0 answers

Why is my ANOVA output identical when comparing two models?

I am comparing two models in order to see if a specific interaction (SessionGroup) is significant. Mod1 is the full model, Mod2 is the full model MINUS the SessionGroup interaction. mod1 = lmer(accuracy ~ session + trialtype + group +…
CogNeuro123
  • 33
  • 1
  • 6
0
votes
0 answers

Create multilevel dataframe from scratch

I'm trying to create a multilevel data structure for power simulation using 'simr' package. The data has 5 columns: pupil, class, extroversion, teacher experience, pupil gender. Pupils are nested in class, extroversion (grand mean centered,range…
Tokaalmighty
  • 402
  • 4
  • 15
1 2 3
10
11