# Tagged Questions

19 views

### How to combine two data sets (level-1 and level-2 data sets) for multilevel analysis in R

I want to analyze data from TIMSS on mathematics. Data contains two data sets one for student level information (i.e. level-1) and another one for school level information (i.e. level-2). Data sets ...
28 views

### Group effects where there is a single group

Suppose I have a table of subjects and measurements as follows subject measurement s1 1 s1 2 s1 3 s1 4 s1 5 s1 6 s1 7 s1 8 s1 9 s1 ...
179 views

### Difference between two mixed effects models

I have a question about how to tell two different mixed effects models apart. In the simple case both involve fitting a model with a random group effect and a covariate. I fit the model with ...
156 views

### nlme beginner question [closed]

I am trying to fit a mixed model to my data using the nlme library in R. Here's what I have: ...
158 views

### Mixed/hierarchical/multilevel model for n-of-1/single-subject design: incorporating baseline data?

So I often do little self-experiments where I blind & randomize things; these can be formulated as your normal t-tests, but sometimes the measured metrics have extensive baselines which seem like ...
147 views

### Multilevel modeling of experimental data with repeated measures in the same condition of factorial experiment

I'm struggling with modeling some experimental data using the lme4 package in R, and would appreciate input. My experimental design is as follows: subjects ...
44 views

### Preparation of categorical data for hierarchical clustering

I would like to use R to perform a hierarchical clustering of data that looks like this: L1 L2 L3 F1 p pr r F2 p NA r which is supposed to ...
48 views

### Do Cross-level interactions must include the constitutive terms in the 1st level?

I have an equation like the following in the first level: $$Y = b_0 + b_1X_1$$ And in the second level, I have a variable $X_2$ which effect only makes sense on $b_1$, not directly on the mean of ...
95 views

### How to do Empirical Bayes Estimation of HLM parameteres in R?

I am modelling the impacts on students' achievemens using HLM (2 levels only), with the lme4 package in R. I would like now to estimate the Empirical Bayes Estimates and the Empirical Bayes Grand ...
77 views

### Time Series Data with Varying Start and End Dates

I've done some research and it doesn't seem this question has been directly answered. I have a situation where the outcome variable is measured monthly from 1975-current and then multiple predictors ...
161 views

### Details on specifying random parameters in 3-level HLM in R

I am used to fitting 3-level HLM with HLM software, but now I am moving to nlme or lme4 in ...
78 views

### Is it possible to estimate non-nested levels in a multilevel model in R?

I have a research data with 3 levels of agregation: level1 is the individual, level2 is house area and level3 is school. This means, the levels are not nested in the usual way (level1 within level2 ...
340 views

### Data visualization from hierarchical clustering

I have data from questionnaire from school. 35 questions are various questions (influence of friends etc.) Possible answers for 35 questions are "definitely yes", "mostly yes", "mostly no" and ...
174 views

### multilevel-model, lmer()-spelling and interpretation?

I m working on a piecewise linear growth model and I need help to understand how to write my lmer() code and how to interpret the ...
84 views

### Calculating level 2 variable based on mean of level 1 variable with multilevel model in R

I have 299 surveys collected from 299 individuals working at 26 different locations. I want to understand how the location specific features relate to the individual survey scores. The only inference ...
846 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 ...
1k views

### Using glmer to replicate result from lmer for mulitlevel modelling in R

Having read from the internet that glmer and lmer are similar thing (correct me if I am wrong), just ...
164 views

### Measuring effects of categorical factors on binomial outcome with many groups

I'd like to do some analysis of shooting efficiency in basketball when a team is leading (AHEAD) or trailing (BEHIND) by less than 8 points and whether they are HOME or AWAY. Here are a few examples ...
299 views

### Which R package for estimating a multilevel Weibull regression model?

Could you recommend an R package for estimating a (frequentist) multilevel Weibull regression model? I need to model random intercepts, random slopes, as well as a cross-classified structure. ...
131 views

### Adding 2nd level variable into Multi-level Modelling in R

I have a dataset (data.mrsa) about the MRSA prevalence of elderly in long term care facilities (LTCF) with the following information: mrsa_result: MRSA result of ...
212 views

### What is the difference between corAR1 and corCAR1 correlation structures?

I'm fitting a mixed multilevel model in R using the nlme package, and I don't understand what is the difference between the covariance structures corAR1 and ...
128 views

### How to add features of the 2nd level into a multi-level regression?

My dataset contains variables of two levels, say individuals and regions. Each level has features. Note that the level2 features are repeated within each level2_ID. ...
488 views

### Multilevel covariance structure and more

I have some doubts about the covariance structure in a multilevel model fitted in R (using the nlme package). I'm not an expert (just starting to learn ...
1k views

### error in getting predictions from a lme object

I am trying to get predictions for observations from a lme object. This is supposed to be quite straightforward. Yet, since I am get different types of errors for different trials, it seems to me I ...
169 views

### Variance and multiple levels in clmm

I'm trying to fit a multi-level model where people are nested in groups. V1 is my outcome variable. G2 is my highest level group and G1 is a group nested within G2 ...
330 views

### Problems of specifying constrained parameters in a hierarchical model under JAGS

I'm trying to fit a model under JAGS where I have a response, y, that depends linearly on eight predictors (with no intersect : I'm actually trying to evaluate the share of each socioeconomic statuts ...
149 views

### How to implement a two-stage hierarchical model of time series data in R?

I'm currently working with a data set that consists of a monthly case count for several sites, along with a number of site-specific covariates. We're trying to estimate the effect of one of them on ...
105 views

### Dynamic consistency and multilevel models using lmer

I've been using nlme and more recently lmer to fit multi-level models of time course data using orthogonal polynomials. My ...
4k views

### Standardized beta weights for a multilevel regression

How can one obtain standardized (fixed effect) regression weights from a multilevel regression? And, as an "add-on": What is the easiest way to obtain these standardized weights from a ...
551 views

### Illustrative datasets and analysis for multilevel modelling

I recently took an introductory course on multilevel modelling. Most of the datasets and examples we used were from the social sciences. I've just got a 2 week internship in a biostatistics ...
170 views

### Multi-level beta regression package for R?

I want to run multi-level beta regression with two levels (years nested within geographic pixels). I know about betareg, but as far as I know it doesn't have a multi-level option. Thanks.
2k views

### Fitting a multivariate ARIMA model with R

I have 4 correlated time series, and I want to predict one of them, from the other 3. There is a clear seasonal effect in the 4 time series, so my first thought was to fit a multivariate ARIMA model, ...
195 views

### Inversions in hierarchical clustering

I'm using heatmap.2 to cluster my data, using the centroid method for clustering and the maximum method for calculating the distance matrix: ...
267 views

### How to run use lmer in R to assess effect of condition, task order, and type of rating?

I would like to estimate a multivariate model with the following properties: Fixed effects: Intercept Main effect of condition Main effect of Task order Task order X Condition interaction ...
3k views

### Three-level hierarchical regression using lmer

I would like to fit a 3-level hierarchical regression in lmer, however, I don't know how to specify the grouping factor above the second level. the model would be: ...
2k views

### Multilevel regression using lmer function in R and Stata

I have a large dataset and have performed a multilevel regression in Stata, the model is the following: ...
280 views

### Hierarchical modeling in R

Here i am again. From this script: ...
242 views

### Estimating correlated parameters with multi-level model

I would like to estimate a multi level model in Stata or R (using lmer) where the first level coefficients are the same for all observations, but the coefficients within observation are correlated. ...
2k views

### Stepwise model selection, Hosmer-Lemeshow statistics and prediction success of model in nested logistic regression in R

is it possible to do stepwise (direction = both) model selection in nested binary logistic regression in R? I would also appreciate if you can teach me how to get: Hosmer-Lemeshow statitistic, Odds ...
64 views

### Testing for the effect of an intervention when it is applied on a group of which each individual is measured

Suppose we have 500 students nested in 20 classes (different classrooms), 25 students per class student<-factor(1:500) class<-rep(LETTERS[1:20],each=25) ...
2k views

### R package for multilevel structural equation modeling?

I want to test a multi-stage path model (e.g., A predicts B, B predicts C, C predicts D) where all of my variables are individual observations nested within groups. So far I've been doing this through ...
718 views

### Correct specification of longitudinal model in lme4

I am trying to fit a multilevel longitudinal model and i have a question regarding how to specify it. The data consist of about 8k observations collected from about 3k individuals at four time ...
654 views

### Multiple imputation for clustered data

I have a few questions regarding multiple imputation for nested data. Context: I have repeated measures (4 times) from a survey and these are clustered in workplaces (205 workplaces). There are about ...