Multi-level modelling (with more than two levels)

Data: tvsfp.dta

Our target variable in these data is a pupil’s score on the "Tobacco and Health Knowledge Scale" (THKS) – it measures what a pupil knows about smoking and health. As possible predictors we have in our data:

- CC: whether the pupil took the "social resistance classroom intervention" (a sort of course in which one teaches pupil show to cope with social pressure of others)

- TV: whether the pupil was shown a TV-documentary on tobacco and health

- CCTV: the interaction of the two (this you could have created yourself of course, but it is already in there)

- PreTHKS: the score of the pupil on the test before the intervention.

Except these, the data also has the class ids and the school ids of the pupils.

You can read a bit more about the data in the paper (on the course website) by Flay et al. Before you analyze, check the data. Which variables are measuring what? Are the CC and TV variables varying within classes?

Your target variable is PostTHKS (=Y). Note that you could argue here that it might be more useful, or at least also useful, to consider “PostTHKS minus PreTHKS” as the target, but we won’t do that.

1) Why is this a multi-level regression? Why would the residuals in a normal regression not be independent?

2) Given the first question: what would probably happen if you were to run a normal multiple regression?

We now first pretend that the data are not clustered.

3) Run a standard multiple regression of PostTHKS on PreTHKS, CC, TV, en CCTV. Interpret the results. Check for interaction effects with PreTHKS. Check for influential cases in the data (use diag2) Consider whether it would make sense to transform your Y-variable (and do this, if you think it does). Check the regression assumptions.

As of here: multi-level regression:

4) Run a variance component model (an empty one), taking into account that pupils are clustered within classes. How large is the part of the variance at the class level? Test whether this part is significantly different from zero (NB use xttest0 for that, right after the xtreg command)

5) As above, now taking the clustering at the school-level into account.

Adding variables and averaging across clusters.

6) Consider the variables PreTHKS, CC en TV. For which of these does it make sense to split them in a class mean and a deviation for the class mean? The same question, now for the school level.

7) Run a multi-level regression of PostTHKS on PreTHKS, CC, TV, and CCTV, taking clustering at the class level into account. Interpret your findings.

8) Run a multi-level regression of PostTHKS on PreTHKS, CC, TV, and CCTV, taking clustering at the school level into account. Interpret your findings.

9) Test the standard regression assumptions, including for multi-level (if possible).

And …

10) Run a multi-level regression of PostTHKS on PreTHKS, CC, TV, and CCTV, taking into account that pupils are nested within classes, and classes within schools.

Thusfar we only looked at the effects of clustered data on the constant: not all classes (or schools) have the same c0 value. The same principle we can apply to other coefficients (“random slopes”). See the slides of this week.

11) Use multi-level analyses to test whether the effect of CC varies per class. (use xtmixed)

2