All Questions
349 questions
440
votes
9
answers
893k
views
What is the difference between fixed effect, random effect in mixed effect models?
In simple terms, how would you explain (perhaps with simple examples) the difference between fixed effect, random effect in mixed effect models?
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 ...
233
votes
3
answers
198k
views
R's lmer cheat sheet
There's a lot of discussion going on on this forum about the proper way to specify various hierarchical models using lmer.
I thought it would be great to have all ...
64
votes
2
answers
68k
views
What is a difference between random effects-, fixed effects- and marginal model?
I am trying to expand my knowledge of statistics. I come from a physical sciences background with a "recipe based" approach to statistical testing, where we say is it continuous, is it normally ...
20
votes
5
answers
19k
views
Fixed effect vs random effect when all possibilities are included in a mixed effects model
In a mixed effects model the recommendation is to use a fixed effect to estimate a parameter if all possible levels are included (e.g., both males and females). It is further recommended to use a ...
35
votes
2
answers
54k
views
REML or ML to compare two mixed effects models with differing fixed effects, but with the same random effect?
Background: Note: My data set and R code are included below text
I wish to use AIC to compare two mixed effects models generated using the lme4 package in R. Each ...
31
votes
5
answers
8k
views
What is the mathematical difference between random- and fixed-effects?
I have found a lot on the internet regarding the interpretation of random- and fixed-effects. However I could not get a source pinning down the following:
What is the mathematical difference between ...
13
votes
3
answers
35k
views
Difference between fixed effects dummies and fixed effects estimator?
I started to read about panel regression models. However, I am a bit confused about the different model specifications in the fixed effects model:
Does a fixed effects panel regression always mean ...
19
votes
4
answers
33k
views
How to keep time invariant variables in a fixed effects model
I have data on a large Italian firm's employees over ten years and I would like to see how the gender gap in male-female earnings has changed over time. For this purpose I run pooled OLS:
$$
y_{it} = ...
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 ...
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 ...
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 ...
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 ...
11
votes
1
answer
29k
views
How do I interpret a "difference-in-differences" model with continuous treatment?
How do I interpret the ATE coefficient (i.e., the post-treatment indicator interacted with the continuous variable)? Does it make sense?
Should I break it down into subgroups and just run a fixed ...
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
<...
17
votes
3
answers
29k
views
Difference-in-differences with individual level panel data
What is the correct way to specify a difference in difference model with individual level panel data?
Here is the setup: Assume that I have individual-level panel data embedded in cities for multiple ...
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 ...
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 ...
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 ...
46
votes
4
answers
80k
views
Standard error clustering in R (either manually or in plm)
I am trying to understand standard error "clustering" and how to execute in R (it is trivial in Stata). In R I have been unsuccessful using either plm or writing my ...
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 ...
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 ...
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 ...
17
votes
3
answers
9k
views
Concepts behind fixed/random effects models
Can someone help me to understand fixed/random effect models? You may either explain in your own way if you have digested these concepts or direct me to the resource (book, notes, website) with ...
17
votes
2
answers
57k
views
Difference between one-way and two-way fixed effects, and their estimation
Consider a basic linear unobserved effect panel data model, e.g.:
$$Y_{it}=\beta x'_{it}+c_i+\lambda_t+u_{it}, \quad t=1,\dots,T$$
where the vector $x_{it}$ contains the independent variables and $u_{...
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 ...
9
votes
1
answer
5k
views
Interpretation of main effect when interaction term is significant (ex. lme)
As an example I use Pinheiro, J. C. & Bates, D. M. 2000. Mixed-effects models in S and S-PLUS. Springer, New York. page 225. Rats whose body mass has been measured are fed by 3 different diets ...
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 ...
1
vote
1
answer
2k
views
Clustering Standard Errors for Panel Data with multiple groupings
I have a Group-Firm-Year panel data set (i.e., multiple firms make up a group). Suppose I have exogenous variation at the group level over time. In a panel regression with firm and time fixed effects ...
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.
30
votes
5
answers
5k
views
What is the upside of treating a factor as random in a mixed model?
I have a problem embracing the benefits of labeling a model factor as random for a few reasons. To me it appears like in almost all cases the optimal solution is to treat all of the factors as fixed.
...
21
votes
2
answers
5k
views
Big disagreement in the slope estimate when groups are treated as random vs. fixed in a mixed model
I understand that we use random effects (or mixed effects) models when we believe that some model parameter(s) vary randomly across some grouping factor. I have a desire to fit a model where the ...
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 ...
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 ...
13
votes
2
answers
25k
views
Why do random effect models require the effects to be uncorrelated with the input variables, while fixed effect models allow correlation?
From Wikipedia
There are two common assumptions made about the individual specific effect, the random effects assumption and the fixed effects assumption. The random effects assumption (made in a ...
9
votes
3
answers
8k
views
panel data - within-group estimate - individual fixed effects retrieved
I am analyzing panel data.
First, I have to decide whether to use a random or fixed effect estimator.
The Hausman test suggests to use the fixed effect estimator (also named within group estimator). ...
7
votes
1
answer
2k
views
Use of fixed effects and random effects
When can we do a linear regression without fixed or random effects and when do we need to use those in the regression analysis? I have tried studying a lot but have got only a vague idea. I would be ...
6
votes
1
answer
5k
views
Hausman test: the larger the sample the more significant the Hausman test statistic?
Hausman test statistic formula:
$$
H=(\beta_{f}-\beta_{r})' \left[\mathrm{Cov}(\beta_{f})-\mathrm{Cov}(\beta_{r})\right]^{-1}(\beta_{f}-\beta_{r} )
$$
where $\beta_{f}$ is the beta of fixed effects ...
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 ...
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 ...
30
votes
1
answer
30k
views
Incidental parameter problem
I always struggle to get the true essence of the incidental parameter problem. I read in several occasions that the fixed effects estimators of nonlinear panel data models can be severely biased ...
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 ...
16
votes
4
answers
610
views
How can I improve my analysis of the effects of reputation on voting?
Recently I had done some analysis of the effects of reputation on upvotes (see the blog-post), and subsequently I had a few questions about possibly more enlightening (or more appropriate) analysis ...
16
votes
1
answer
13k
views
When is it necessary to include the lag of the dependent variable in a regression model and which lag?
The data we want to use as dependent variable looks like this (it is count data). We fear that since it has a cyclic component and trend structure the regression turns out to be biased somehow.
We ...
15
votes
1
answer
41k
views
difference-in-differences with fixed effects
I have two questions related to having fixed effects in the DD model.
I have a treatment that occurs at different times (e.g., 2001, 2005, etc.).
I want to fit a DD model, so I standardize the ...
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 ...
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 ...
12
votes
6
answers
7k
views
Bootstrapping hierarchical/multilevel data (resampling clusters)
I am producing a script for creating bootstrap samples from the cats dataset (from the -MASS- package).
Following the Davidson ...
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 ...
9
votes
2
answers
2k
views
Does a distance have to be a "metric" for an hierarchical clustering to be valid on it?
Let us say that we define a distance, which is not a metric, between N items.
Based on this distance we then use an Agglomerative hierarchical clustering.
Can we use each of the known algorithm (...