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
2
votes
1 answer

How to get p-values for random effects in glmer

I want to analyze when the claims of a protest are directed at the state, based on action and country level characteristics, using glmer. So, I would like to obtain p-values of both the fixed and random effects. My model looks like this: targets <-…
Spl4t
  • 53
  • 8
2
votes
0 answers

Dependent variable is constant for some groups

My research question implies using several independent variables that describe country-years and countries in general (to keep question reasonably simple, let's suppose I don't have any '2nd level' variables, and all I have in the right-hand side…
2
votes
0 answers

Python: Random intercept model (have to replicate R code)

I'm trying to replicate code from R that estimates a random intercept model. The R code is: fit=lmer(resid~-1+(1|groupid),data=df) I'm using the lmer command of the lme4 package to estimate random intercepts for the variable resid for observations…
Hamza
  • 63
  • 1
  • 7
2
votes
0 answers

nlme or lme4 multi-level model with two repeated measures (either nested or crossed). how to model?

I have a question regarding the modelling of fixed effects and random effects of two repeated measures. My dataset looks like this: subject id condition trial DV 1 1 1 2 1 1 …
Anna
  • 21
  • 1
2
votes
2 answers

Reshape/gather function to create dataset ready for multilevel analysis

I have a big dataset, with 240 cases representing 240 patients. They all have undergone neuropsychological tests and filled in questionnaires. Additionally, their significant others (hereafter: proxies) have also filled in questionnaires. Since…
Hannie
  • 417
  • 5
  • 17
2
votes
2 answers

Filter columns by values in a row in Pandas

I have obtained the statistics for my dataframe by df.describe() in Pandas. statistics = df.describe() I want to filter the statistics dataframe base on count: main Meas1 Meas2 Meas3 Meas4 Meas5 sublvl Value Value Value …
Moiraine24
  • 369
  • 1
  • 5
  • 16
2
votes
0 answers

Multilevel multinomial logistic regression with mlogit (R)

I´m trying to model a multilevel multinomial logistic regression. I have 42 subjects with 82 observations per person. In each observation the suvjects("VP") were able to react in three different ways mldata <- mlogit.data(data1, choice =…
1
vote
0 answers

extract id-specific coefficients of a multilevel ordinal regression for the different combination of factor levels

I ran this multilevel ordinal regression using clmm from the ordinal package library(ordinal) set.seed(1) dat <- data.frame(day=rep(seq(1,10,1),times=20), product=rep(c("A","B"),each=100),id=rep(seq(1,10,1),each=10), rating=factor(round(runif(200,…
locus
  • 387
  • 2
  • 9
1
vote
1 answer

estimates and significance level of categorial variables are not shown in output of lmer function

I am trying to run a multilevel regression analysis with the following script. M5 <- lmer( health_complaints ~ thinkbody_3cat_ref + IOTF3_ref + sex_ref + age_GMC + fas_sum + thinkbody_3cat_ref*IOTF3_ref +(1|id2), …
1
vote
1 answer

Multilevel mediation analysis in R with mlma package produces errors

I would like to perform a multilevel mediation analysis in R with the mlma package. My code is based on the example for these analyses here: https://rdrr.io/cran/mlma/f/vignettes/MLMAvignette.Rmd. Overall, I am very unsure whether my code is…
Bila
  • 11
  • 2
1
vote
0 answers

Association rule mining with R (arules package)

I have a given dataset about the orders of a store. | Order.ID | Category | Sub.Category | Product.Name | | --------------- | -------- | ------------ | ------------ | | 1 | 2 | Furnishings | ProductName1 | | 2 …
justAUser
  • 11
  • 4
1
vote
0 answers

different results in multilevel meta-analysis with two similar packages in R (metafor and mixmeta)

I am conducting a multilevel meta-analysis to evaluate vaccine effectiveness (VE) across several longitudinal studies. Each study reports VE for some time points. Multilevel meta-analyses with similar packages in R (metafor and mixmeta) show…
Farideh
  • 11
  • 3
1
vote
1 answer

Pandas: how to deal with data associated with higher levels of hierarchical index?

I have a Pandas dataframe similar to (but much larger than) : dob name x y subject_code datapoint subject1 0 2000 …
S. Dauncey
  • 27
  • 6
1
vote
0 answers

mice multilevel imputation multiple variables

I am trying to do multiple imputation using the mice package in R for multilevel models. i am following the steps listed out in here and here to set up my predictor matrix. however, the examples provided only include not more than 7 variables in the…
dek2888
  • 11
  • 2
1
vote
0 answers

use.u=TRUE in bootMer function

I have a question about boostrapping confidence intervals for the random effects (BLUPs) of a multilevel model. I'm currently using bootMer and there is an argument use.u=TRUE that allows one to treat the BLUPs as fixed instead of re-estimating…
jonnyf
  • 198
  • 8
1
2
3
10 11