- 00:00
[MUSIC PLAYING]

- 00:11
E.C. HEDBERG, PHD: Hello.My name is E.C. Hedberg Ph.D, and I'man affiliated researcher at NORC at the University of Chicago.And I'm also an assistant professorat Arizona State University.And today, this video is going to be a backgroundto multilevel modeling.In this tutorial, we're going to talk about a few things.First, we're going to talk about what are fixed

- 00:31
E.C. HEDBERG, PHD [continued]: and random effects.Then we'll talk about what problems multilevel modelssolve.Finally, we'll end with when you should use a multilevel model.And then I'll give a brief summary.[What are fixed effects?]So let's start first with fixed and random effects.

- 00:52
E.C. HEDBERG, PHD [continued]: Mixed models are models that includeboth fixed and random effects in the same model.So it's important to understand exactly what we'retalking about.So let's organize our data a little bit.First we have an outcome yij.Now what the i's and the j's mean is they'reidentifiers of groups and units within the cluster.So first, let's talk about the groups.

- 01:12
E.C. HEDBERG, PHD [continued]: We have 1, 2, up to m groups, which we use the subscript jto identify.And then within each group or cluster,we have 1, 2, 3, up to n units within each cluster.And we'll subscript those with i.And so the total number of cases within each of these modelsis n, which is equal to m times n.

- 01:34
E.C. HEDBERG, PHD [continued]: So this is the linear model that yousee on the screen for a fixed effects model.We have yij, which is equal to an overall average, which we'llcall the Greek letter mu, and a fixed effect for each group,which is alpha sub j.And then we have a within group error term, ei sub j.And as we can see on the screen here,

- 01:55
E.C. HEDBERG, PHD [continued]: I've identified the outcome, which is yij.The overall mean mu, and the treatment effect,which in this case is the fixed effect, alpha sub jwith a within group residual e i sub j.Now one thing we have to keep in mind with these fixed effectsmodels is that we have to constrain the fixed effects so

- 02:15
E.C. HEDBERG, PHD [continued]: that alpha sub j sums across all the groups to 0.So let's talk about fixed effects.Fixed effects are unique in that theyare the effects for all possible groups of interest.So treatments are generally fixed.Treatments and experiments are generally fixed,because we experiment with all treatments of interest.We have a control group, say.

- 02:35
E.C. HEDBERG, PHD [continued]: We have a treatment group.We're not really interested in any other possible groups.And so because we have all the groups,we don't have any various componentsfor the fixed effects.Now we have to keep in mind that all those residualsthat we talked about are distributed normallywith a mean of 0 and a variance which we'll call sigmasquared w.And the w stands for within group.

- 02:57
E.C. HEDBERG, PHD [continued]: And so again.The variance of yij given the treatment effects, or alpha subj, is the within group variance-- sigma squared w.To summarize fixed effects, the most important thing for youremember is that there are effects about all the groupsof possible interest.So that's usually treatment group,sometimes it could be gender group.Sometimes it could be race groups.

- 03:18
E.C. HEDBERG, PHD [continued]: But they're all the groups that are availableand of research interest.[What are random effects?]Next let's move on to random effects.Now random effects are different from fixed effects,because they're from a sample of the groups of interest.And because they're from a sample,that introduces variance.

- 03:40
E.C. HEDBERG, PHD [continued]: And because we have variance, we have variance componentsfor the random effects.For example, instead of a population,which is usually what we have fixed effects for,next we have a sample.And this is what the random effects are for.So we've changed our linear model a little bit,now yij is equal to an overall mean plus aj plus a

- 03:60
E.C. HEDBERG, PHD [continued]: within group residual eij.Notice that we've gone from the Greek letter alpha to the Romanletter a.And that means it's a random effect.So when we think about the within group residuals again,they're still distributed normal, with a mean of 0and a variance sigma squared w.But now the random effects for the groups, a sub j,

- 04:20
E.C. HEDBERG, PHD [continued]: is also distributed normal with a mean of 0and a sigma squared b-- b for between groups.So the total variance of y, variance yij,is the total variance which can be broken into sigmasquared b plus sigma squared w.And so sigma squared b and sigma squared

- 04:41
E.C. HEDBERG, PHD [continued]: w are what we call variance components,because they're the components of the total varianceof the outcome.Sigma squared B also has a special meaningas the intraclass covariance.In other words, it's how cases within the same groupcovaried with each other.However, covariance, even with Stats 101,is hard to interpret.

- 05:01
E.C. HEDBERG, PHD [continued]: And so instead, we convert that into an ICCor an intraclass correlation.And the intraclass correlation, as you can see,is the ratio of sigma squared b, to the total variance sigmasquared b plus sigma squared w.So to summarize random effects, random effectsare different from fixed effects,because the random effects come from a sample

- 05:23
E.C. HEDBERG, PHD [continued]: of the groups, not all possible groups of interest.So usually when we think of samples,we think of samples of schools or samples of neighborhoods.These comprise random effects.[What are mixed effect models?]So now we know what fixed effects are.Now we know what random effects are.

- 05:43
E.C. HEDBERG, PHD [continued]: Now we can talk about mixed effects models.And mixed effects are what exactly what they sound like.They mix both fixed and random effects.And so usually, for example, clusters such as schools,or neighborhoods, comprise the random effects.And then treatments, or other covariates of interest,compromise the fixed effects.

- 06:04
E.C. HEDBERG, PHD [continued]: So again, let's organize our data a little bitand understand what we're talking about here.We have yij now k.So we have three subscripts.k stands for the treatments.And they go from 1, 2 up to p treatments.And then we have clusters per treatment.So we have 1, 2, up to m clusters per treatment.

- 06:25
E.C. HEDBERG, PHD [continued]: And then we have the units within the cluster i equals 1,2, 3 up to n units per cluster.And that makes the total number of cases nequals p times m times n.So here's the linear model for a mixed effect model.We have y sub ijk is equal again to an overall mean,

- 06:46
E.C. HEDBERG, PHD [continued]: plus a random effect for the groups, ajk plus fixed effects,say for treatments, which is beta kplus again, our residual within each group, eijk.So at this point this is where a lot of peoplebecome very confused.And so this is a way to visualize these treatmentsin groups and all the rest of it.

- 07:07
E.C. HEDBERG, PHD [continued]: Imagine we did an experiment where we randomized schoolsto a treatment and a control condition.Within each school there are a bunch of students.But we can see that control schools, schools 1 and 2are all part of the control condition.The treatment schools, schools 3 and 4,are part of the treatment condition.And if this looks hierarchical well,it is, because this is a hierarchy to the data.

- 07:31
E.C. HEDBERG, PHD [continued]: Again, we can translate this hierarchyinto the linear model we just reviewed,instead of treatments.Now we have the betas 1 and 2.And instead of the schools, we have a1 a2, a3, and a4.So again, we have our various components.The ajk is distributed normal with the mean of 0and a variance sigma squared b, just as before.

- 07:53
E.C. HEDBERG, PHD [continued]: The within group residuals eijk are alsodistributed normal, with a mean of 0and a variance sigma squared w.And the total variance net of the treatment effects,is yijk is equal to again, the total variation, whichis equal to sigma squared b for the between groups,plus sigma squared w for the within group.

- 08:15
E.C. HEDBERG, PHD [continued]: Now what's important to know is that mixed effects modelsare not just for experiments.They're not just for treatments.So let's visualize this with a graph.We have a model, which is yij, whichis equal to an intercept beta 0, plus a group effect, ajplus the slope for a covariate say,x beta 1 times xij plus the residual ei eij.

- 08:39
E.C. HEDBERG, PHD [continued]: So we have three lines, which means we have three groups.And we see that for group 2, they don't have a group effect.So a2 is equal to 0.So their intercept is the model's intercept.But for group 1, their intercept is a little higher.It's about 1.5 points higher.But their slope, again, is the same as all the other groups.And again, the intercept for group 3 is 0.4.

- 09:02
E.C. HEDBERG, PHD [continued]: So their effect is a little lower.And so we have three groups, same slopes-- we're set to go.Now let's introduce a much more complicated model.Now we have an outcome yij, whichis equal to an intercept beta 0 plus again, a group effectaj, plus again, a slope for the covariant x beta 1 xij.

- 09:25
E.C. HEDBERG, PHD [continued]: But now each group has a slightly different slope.So we have this next RAM affect cj times xij.And then of course, we end with the within group residual.So here's a graph where we have different interceptsfor each group and different slopes for each group.And so now the overall model is yij,

- 09:46
E.C. HEDBERG, PHD [continued]: which is equal to an intercept beta 0, plus a group effect ajagain, plus again an overall slope beta 1 xij.Next, each group has a slightly different slope.So we have a new random effect cj,which is multiplied against the covariate xij.And then again, we end with an overall residual.And so as we can see here on the graph,

- 10:08
E.C. HEDBERG, PHD [continued]: that each group has its own intercept,its own starting point on the y-axis, and its own slope.And so this is a situation in which we have a mixed effectsmodel where we have not only a mixture of mean differences,which are reflected in the intercept,but we have differences in the effectof x, which is summarized with that c variable in the model.

- 10:29
E.C. HEDBERG, PHD [continued]: So to summarize mixed effects models,mixed effects models include both fixed and random effects.And so we can have fixed effects from say, treatments,or covariants such as gender or race.And then we could have random effectsfrom the random sample of groups that weuse in our multi-level models.And so that's why we call them mixed effects models.

- 10:50
E.C. HEDBERG, PHD [continued]: [What problems do multilevel models solve?]So what problems do multilevel models solve?Why would we want to do this?Well, if you have a sample of groups,and you have a sample of individuals,or units within each of those groups,you can't use the standard ordinary least squares

- 11:10
E.C. HEDBERG, PHD [continued]: regression with this cluster data.It'll give you standard errors thatare usually too small, leading to false, null hypothesisrejections.In other words, if you don't take the clusteringinto account, you'll think you'llhave a significant effect, when in fact you may not.So multi-level models produce the correct standard errors,and thus the correct hypothesis tests.

- 11:33
E.C. HEDBERG, PHD [continued]: And multi-level models are also nifty,because they can estimate all these various componentsof the random effects.[When should you use multilevel models?]So when should you use multilevel models?Around the turn of the century in the early 2000s,everybody was using multilevel models.

- 11:54
E.C. HEDBERG, PHD [continued]: They were the thing to use.And some people actually didn't need to use them.So when would you actually want to use multilevel models?The very first question you should ask yourself isare there random effects?Are you dealing with a sample of groups?And do you want to generalize your modelbeyond your observed groups?So if you have a sample of say, neighborhoods,

- 12:15
E.C. HEDBERG, PHD [continued]: and you want to generalize to the entire city,or you have a sample of counties,a generalized to all the counties is in country.Now sometimes you may have all the neighborhoods,or you may have the counties.So then you could ask yourself, are youtrying to generalize to what we calla super population-- all possible counties,or all possible neighborhoods, or all possible schools?

- 12:38
E.C. HEDBERG, PHD [continued]: And then finally, you want to ask yourself,do you want to estimate various components?Do you want to have random slopes?Do you want to say the effect of some covariateis different across all these groups?And the variance of those different effectsis such and such.These are the situations in which youwant to use multilevel models.[Conclusion]

- 13:02
E.C. HEDBERG, PHD [continued]: So let's summarize everything we've talked about.We've talked about multilevel models as mixed effects models.And the reason why we call them mixed effects modelsis because they mix both fixed effects, usuallyfrom treatments or other covariates,where we have all the possible groups.And then we have random effects, usually comingfrom a sample of clusters.

- 13:22
E.C. HEDBERG, PHD [continued]: And the sample of schools, or a sample of neighborhoods,or a sample of counties, in whichwe need to estimate the variance of how the means differ,or the variance of how the slopes of other covariatesdiffer.So to really understand these multilevel models, of course,you need more than this video.And so what you want to do is you want to pick up--in my opinion, three books.

- 13:43
E.C. HEDBERG, PHD [continued]: First, you want to pick up Raudenbush and Bryk'sHierarchical Linear Models.Other good sources-- this is a little bit more technical--is McCulloch and Searle, General, Linear, and MixedModels.That's also a really good book.It has a good discussion on the differencebetween fixed and random effects.And then finally, Goldstein's Multilevel Modelsin Education and Social Research is a classic.

- 14:05
E.C. HEDBERG, PHD [continued]: [MUSIC PLAYING]

### Video Info

**Publisher:** SAGE Publications Ltd

**Publication Year:** 2017

**Video Type:**Tutorial

**Methods:** Multilevel analysis

**Keywords:** practices, strategies, and tools

### Segment Info

**Segment Num.:** 1

**Persons Discussed:**

**Events Discussed:**

**Keywords:**

## Abstract

Dr. E.C. Hedberg discusses multilevel modeling and how to use it. Multilevel models accommodate for clustering in data, which results in more accurate standard errors and significance testing. Hedberg also explains fixed, random and mixed effects, and how they can affect study results.