Skip to main content

All Questions

Filter by
Sorted by
Tagged with
202 votes
1 answer
162k views

Crossed vs nested random effects: how do they differ and how are they specified correctly in lme4?

Here is how I have understood nested vs. crossed random effects: Nested random effects occur when a lower level factor appears only within a particular level of an upper level factor. For ...
Joe King's user avatar
  • 3,942
44 votes
1 answer
18k views

How do you deal with "nested" variables in a regression model?

Consider a statistical problem where you have a response variable that you want to describe conditional on an explanatory ...
Ben's user avatar
  • 133k
42 votes
3 answers
68k views

Difference between generalized linear models & generalized linear mixed models

I am wondering what the differences are between mixed and unmixed GLMs. For instance, in SPSS the drop down menu allows users to fit either: ...
user9203's user avatar
  • 689
52 votes
2 answers
131k views

Dealing with singular fit in mixed models

Let's say we have a model ...
User33268's user avatar
  • 1,782
35 votes
2 answers
41k views

Why do I get zero variance of a random effect in my mixed model, despite some variation in the data?

We’ve run a mixed effects logistic regression using the following syntax; ...
Nick Riches's user avatar
24 votes
1 answer
39k views

Fitting a binomial GLMM (glmer) to a response variable that is a proportion or fraction

I'm hoping somebody can help with what I think is a relatively simple question, and I think I know the answer but without confirmation it has become something I just can't be certain of. I have some ...
ALs's user avatar
  • 377
24 votes
2 answers
26k views

How to apply binomial GLMM (glmer) to percentages rather than yes-no counts?

I have a repeated-measures experiment where the dependent variable is a percentage, and I have multiple factors as independent variables. I'd like to use glmer from ...
Dan Stowell's user avatar
  • 1,384
21 votes
1 answer
19k views

How to fit a mixed model with response variable between 0 and 1?

I am trying to use lme4::glmer() to fit a binomial generalized mixed model (GLMM) with dependent variable that is not binary, but a continuous variable between zero ...
amoeba's user avatar
  • 107k
37 votes
2 answers
36k views

Diagnostics for generalized linear (mixed) models (specifically residuals)

I am currently struggling with finding the right model for difficult count data (dependent variable). I have tried various different models (mixed effects models are necessary for my kind of data) ...
fsociety's user avatar
  • 1,185
42 votes
8 answers
26k views

Under what conditions should one use multilevel/hierarchical analysis?

Under which conditions should someone consider using multilevel/hierarchical analysis as opposed to more basic/traditional analyses (e.g., ANOVA, OLS regression, etc.)? Are there any situations in ...
Patrick's user avatar
  • 783
2 votes
1 answer
430 views

Both variables of my GLMM output are significant. Don't know how to interpret it?

This is more of an interpretation question than anything. I have run a GLMM with two fixed factors (both of which have two levels) and two random factors. The outputs from the model are as such: <...
DFinch's user avatar
  • 43
32 votes
3 answers
31k views

What does "independent observations" mean?

I'm trying to understand what the assumption of independent observations means. Some definitions are: "Two events are independent if and only if $P(a \cap b) = P(a) * P(b)$." (Statistical Terms ...
RubenGeert's user avatar
15 votes
1 answer
12k views

OLS with clustered standard errors vs. multilevel modeling when the main interest is at the individual level [duplicate]

Possible Duplicate: Under what conditions should one use multilevel/hierarchical analysis? I have been reading various papers dealing with multilevel analysis, and to be honest, I am still ...
Bill718's user avatar
  • 405
12 votes
1 answer
4k views

Multilevel multivariate meta-regression

Background: I'd like to conduct a meta-regression using studies which have (1) several outcomes/constructs (= multivariate) and (2) multiple effect sizes for every of these outcomes because of ...
Stefan's user avatar
  • 205
46 votes
7 answers
24k views

How to deal with hierarchical / nested data in machine learning

I'll explain my problem with an example. Suppose you want to predict the income of an individual given some attributes: {Age, Gender, Country, Region, City}. You have a training dataset like so <...
Ben's user avatar
  • 1,904
19 votes
2 answers
15k views

Random effect equal to 0 in generalized linear mixed model [duplicate]

Sorry if I'm missing something very obvious here but I am new to mixed effect modelling. I am trying to model a binomial presence/absence response as a function of percentages of habitat within the ...
Cec.g's user avatar
  • 191
11 votes
2 answers
11k views

Conditional vs. Marginal models

I have data with an outcome of 0 or 1 (binary) representing success or failure. I also have two comparison groups (Treatment vs. Control). Each subject in the study contributed 2 observations (the ...
user3275222's user avatar
6 votes
1 answer
4k views

Acceptable values for the intraclass correlation coefficient (empty model)

I'm using xtmixed in Stata to test a Hierarchical Linear Model. My problem is that variance at level 2 is about 4% of the total variance. So most of the variance is ...
Forinstance's user avatar
4 votes
1 answer
6k views

Forecasting hierarchical time series R package

I have to forecast a large set of (hierarchical) time series and since the R package hts allows for confidence intervals for their ensemble, I'd like to use it. I haven't found an example of how to ...
Konsta's user avatar
  • 238
12 votes
4 answers
2k views

Why is it OK to model demographics as random effects in bayesian multilevel models?

In Bayesian multilevel models (with, say, people nested within congressional districts) I sometimes see individual level demographic variables like race modeled as random effects. So here’s a slightly ...
Graham Wright's user avatar
47 votes
2 answers
77k views

How can I test whether a random effect is significant?

I am trying to understand when to use a random effect and when it is unnecessary. Ive been told a rule of thumb is if you have 4 or more groups/individuals which I do (15 individual moose). Some of ...
Kerry's user avatar
  • 1,219
22 votes
4 answers
12k views

How to calculate the confidence interval of the mean of means?

Imagine that you repeat an experiment three times. In each experiment, you collect triplicate measurements. The triplicates tend to be fairly close together, compared to the differences among the ...
Harvey Motulsky's user avatar
17 votes
1 answer
8k views

Compute partial $\eta^2$ for all fixed effects anovas from a lme4 model

Disclamer: I wasn't sure where to post this question: CV or SO, but eventually decided to try here first I've been asked by one of the reviewers to add effects sizes (preferably $\eta^2_p$ which is ...
blazej's user avatar
  • 557
31 votes
2 answers
98k views

r glmer warnings: model fails to converge & model is nearly unidentifiable

I have seen questions about this on this forum, and I have also asked it myself in a previous post but I still haven't been able to solve my problem. Therefore I am trying again, formulating the ...
Brechje van Osch's user avatar
22 votes
5 answers
25k views

How to assess the fit of a binomial GLMM fitted with lme4 (> 1.0)?

I have a GLMM with a binomial distribution and a logit link function and I have the feeling that an important aspect of the data is not well represented in the model. To test this, I would like to ...
Henrik's user avatar
  • 14.4k
21 votes
1 answer
21k views

Difference between multilevel modelling and mixed effects models?

What is the difference between Multilevel/Hierarchical Modelling and Mixed Effects Models? Wikipedia considers them to be the same, i.e. two different names for the same thing. But I think they are ...
skan's user avatar
  • 1,094
19 votes
2 answers
10k views

How will random effects with only 1 observation affect a generalized linear mixed model?

I have a data set in which the variable I'd like to use as a random effect only has a single observation for some levels. Based on the answers to previous questions, I've gathered that, in principle, ...
canderson156's user avatar
16 votes
1 answer
18k views

Marginal model versus random-effects model – how to choose between them? An advice for a layman

In searching for any info about marginal model and random-effects model, and how to choose between them, I have found some info but it was more-or-less mathematical abstract explanation (like for ...
benjamin jarcuska's user avatar
10 votes
1 answer
3k views

Can I fit a mixed model with subjects that only have 1 observation?

I have a very large dataset where I have repeated measurements over time for individual locations. Some locations might have 10 data points and some locations have only 1 data point. I fit a mixed ...
Amateur's user avatar
  • 265
9 votes
1 answer
4k views

Resolving heteroscedasticity in Poisson GLMM

I have long-term collection data, and I'd like to test, whether the number of animals collected is influenced by weather effects. My model looks like below: ...
zozi9126's user avatar
  • 162
8 votes
1 answer
1k views

Why do random effects require a minimum # of levels?

I have always heard random effects require a minimum number of levels to be correctly specified in a hierarchical (mixed-effects) model. I can admit to following this rule without question (mostly ...
Nate's user avatar
  • 2,071
4 votes
3 answers
11k views

What are the assumptions of a Gamma GLM or GLMM for hypothesis testing?

What are the assumptions when doing hypothesis testing using a Gamma GLM or GLMM? Are the residuals suppose to be normally distributed and is heteroscedasticity a concern like the Gaussian (normal) ...
OliverFishCode's user avatar
4 votes
1 answer
3k views

Should quantitative predictors be transformed to be normally distributed?

I am always struggling with normality testing for quantitative predictors (no factors) and transforming them to normality. If I am running a GLMM and my predictors are really non-normal, should I ...
Jens's user avatar
  • 1,635
41 votes
3 answers
10k views

What's the relation between hierarchical models, neural networks, graphical models, bayesian networks?

They all seem to represent random variables by the nodes and (in)dependence via the (possibly directed) edges. I'm esp interested in a bayesian's point-of-view.
cespinoza's user avatar
  • 812
19 votes
1 answer
3k views

How are PQL, REML, ML, Laplace, Gauss-Hermite related to each other?

While learning about the Generalized Linear Mixed Models, I often see the above terms. Sometimes it seems to me these are separate methods of estimation of (fixed? random? both?) effects, but when I ...
humbleasker's user avatar
16 votes
1 answer
23k views

Product Demand Forecasting for Thousands of Products Across Multiple Stores

I'm currently working on a demand forecasting task, with data on tens of thousands of products across a couple thousand stores. More specifically,I have a few years' worth of daily sales data per ...
meraxes's user avatar
  • 739
14 votes
3 answers
5k views

Multilevel model vs. separate models for each level

What are the advantages and disadvantages of running separate models vs. multilevel modeling? More particularly, suppose a study examined patients nested within doctors' practices nested within ...
Peter Flom's user avatar
  • 128k
14 votes
1 answer
16k views

Calculating ICC for random-effects logistic regression

I'm running a logistic regression model in the form: lmer(response~1+(1|site), family=binomial, REML = FALSE) Normally I would calculate the ICC from the ...
Megan's user avatar
  • 175
11 votes
1 answer
12k views

Model selection: can I compare the AIC from models of count data between linear and poisson models?

I am modeling count data (with offset / exposure parameter). My modeling strategy is use of a Poisson model and a negative binomial regression model. I compare model AICs, which are about -760 for my ...
tomka's user avatar
  • 6,724
2 votes
1 answer
2k views

Computation and interpretation of marginal effects in a GLMM

I am currently working on a GLMM model which uses a Poisson distribution and need to compute and interpret marginal effects from this model. The model outcome consists of a count (COUNT) collected ...
Isabella Ghement's user avatar
1 vote
1 answer
667 views

Multilevel Modeling: Clustering by both individual and time, is this okay?

I'm trying to run a multilevel model where I have approximately 30 individuals and anywhere from 20-50 time points per individual. I can cluster them by the individual since the dataset is ...
ssjjaca's user avatar
  • 221
1 vote
1 answer
5k views

Accounting for time in repeated measures glmm, R

I have some count data of advanced stage juvenile snails in tanks that are sampled every 4 days for 4 sample points. I want to see how much the snail development stages change with a changing dosage ...
J.Con's user avatar
  • 207
42 votes
4 answers
80k views

When to use fixed effects vs using cluster SEs?

Suppose you have a single cross-section of data where individuals are located within groups (e.g. students within schools) and you wish to estimate a model of the form ...
QuestionAnswer's user avatar
25 votes
2 answers
15k views

Why is a $p(\sigma^2)\sim\text{IG(0.001, 0.001)}$ prior on variance considered weak?

Background One of the most commonly used weak prior on variance is the inverse-gamma with parameters $\alpha =0.001, \beta=0.001$ (Gelman 2006). However, this distribution has a 90%CI of ...
David LeBauer's user avatar
12 votes
2 answers
4k views

Should I bootstrap at the cluster level or the individual level?

I have a survival model with patients nested in hospitals that includes a random-effect for the hospitals. The random effect is gamma-distributed, and I am trying to report the 'relevance' of this ...
drstevok's user avatar
  • 550
12 votes
1 answer
6k views

Multiple Membership vs Crossed Random Effects

I see that there is a multiple-membership tag, but I can't find a good explanation of what a multiple membership model is, or how to go about fitting one. In my limited understanding, it seem very ...
Joe King's user avatar
  • 3,942
11 votes
2 answers
11k views

Effect size in GLMM

In the output of a GLMM, using a binary variable as response variable and continuous variables as explanatory variables [family = binomial(link="logit")], I obtain, for each variable, an estimate ...
mto23's user avatar
  • 637
11 votes
1 answer
7k views

Is it a must to include a random slope in a mixed model?

I am learning about fitting mixed models and I find when it is justified to include or exclude a random slope rather confusing. Some tutorials suggest that although the maximal random structure should ...
Student's user avatar
  • 125
10 votes
3 answers
407 views

Bacteria picked up on fingers after multiple surface contacts: non-normal data, repeated measures, crossed participants

Intro I have participants who are repeatedly touching contaminated surfaces with E. coli in two conditions (A=wearing gloves, B=no gloves). I want to know if there's a difference between the amount ...
HCAI's user avatar
  • 789
9 votes
1 answer
1k views

Citation for ML vs. REML

Quick question: can anyone give me a citation that I can use to justify using ML when doing model comparisons? Background: I am fitting some multilevel models in R using lme4, and I do a series of ...
Tom Carpenter's user avatar

1
2 3 4 5
7