Top Banner
Contextual effects In the previous sections we found that when regressing pupil attainment on pupil prior ability schools vary in both intercept and slope resulting in crossing lines. The next question is are there any higher level variables that can explain these patterns of variation? Similarly, we found that when regressing person hedonism on person income countries vary in both intercept and slope resulting in crossing lines. That is are there school or country level variables that can explain some of this between school and between country variance we have found.
24

Contextual effects In the previous sections we found that when regressing pupil attainment on pupil prior ability schools vary in both intercept and slope.

Mar 28, 2015

Download

Documents

Chase Rhodes
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Contextual effects In the previous sections we found that when regressing pupil attainment on pupil prior ability schools vary in both intercept and slope.

Contextual effects

In the previous sections we found that when regressing pupil attainment on pupil prior ability schools vary in both intercept and slope resulting in crossing lines.

The next question is are there any higher level variables that can explain these patterns of variation?

Similarly, we found that when regressing person hedonism on person income countries vary in both intercept and slope resulting in crossing lines.

That is are there school or country level variables that can explain some of this between school and between country variance we have found.

Page 2: Contextual effects In the previous sections we found that when regressing pupil attainment on pupil prior ability schools vary in both intercept and slope.

Example Research questions

Interest lies in how the outcome of individuals in a cluster is affected by their social contexts (measures at the cluster level). Typical questions are

• Does school type effect students' educational progress?• Do teacher characteristics effect students' educational progress?• Is a students progress effected by the ability of his or her peers? • Does area deprivation effect the health status of individuals in the area?• Children within families is also a multilevel structure. Does family background effect child developmental outcomes?

Page 3: Contextual effects In the previous sections we found that when regressing pupil attainment on pupil prior ability schools vary in both intercept and slope.

An Educational example

0 1

0 0 0

20

2

0

1

2

2

attainment priorability

~ (0, )

~ (0, )

ˆintercept( ) 0.002(0.040)

ˆpriorability 0.563(0.012)

ˆ 0.092(0.018)

ˆ 0.566(0.013)

ij j ij ij

j j

j u

ij e

u

e

e

u

u N

e N

A question of widespread interest is do children make better academic progress in single or mixed. This is a question about the contextual effect of school gender on child progress.

Consider a random intercept model on our educational data set

Page 4: Contextual effects In the previous sections we found that when regressing pupil attainment on pupil prior ability schools vary in both intercept and slope.

Including school gender contextual effects

0 1 2 3

0 0 0

20

2

0

1

2

3

attainment priorability boysch girlsch

~ (0, )

~ (0, )

contextual

ˆintercept( ) 0.087(0.051)

ˆpriorability( ) 0.563(0.012)

ˆboysch( ) 0.097(0.109)

ˆgirlsch( ) 0.245(0

ij j ij j j ij

j j

j u

ij e

e

u

u N

e N

2

2

.085)

ˆ 0.080(0.016)

ˆ 0.566(0.013)u

e

boys school 0.087 0.563 priorability 0.097 boysc

girlssc

mixedschool 0.087 0.

hool 0.087 0.5

563 prior

63 prio

h

rability 0.0

abili

245 girls

ty

ch

ij

j

ij

j

ij

Make inference that girls in girl schools progress better than girls in mixed schools. Z=0.245/0.85=2.9, p=0.005

Do not make inference that boys in boy schools progress better than boys n mixed schools. Z=0.097/0.109=0.89, p=0.390

Page 5: Contextual effects In the previous sections we found that when regressing pupil attainment on pupil prior ability schools vary in both intercept and slope.

Comparing the models with and without contextual effects

0 1 2 3

0 0 0

20

2

0

1

~ (0, )

~ (0, )

no contextual contextual

ˆintercept( ) 0.002(0.040) 0.087(0.051)

ˆpriorability( ) 0.564(0.012) 0.563(0.012)

boysch(

ij j ij ij

j j

j u

ij e

attainment priorability boysch girlsch e

u

u N

e N

2

32

2

ˆ ) 0.097(0.051)

ˆgirlsch( ) 0.245(0.085)

ˆ 0.092(0.018) 0.080(0.016)

ˆ 0.566(0.013) 0.566(0.013)u

e

Between school variance reduced by 13% as a result of fitting school gender

Between pupil variance unchanged, addition of higher level variables cannot alter variance at lower levels

Page 6: Contextual effects In the previous sections we found that when regressing pupil attainment on pupil prior ability schools vary in both intercept and slope.

Comparing random intercept contextual effects model, with single level contextual effects model

0

1

2

3

single level random intercept

ˆintercept( ) 0.096(0.040) 0.087(0.051)

ˆpriorability( ) 0.594(0.012) 0.563(0.012)

ˆboysch( ) 0.118(0.039), 3.03, 0.002 0.097(0.051)( 0.89, 0.390)

ˆgirlsch( ) 0.236(0.027),

Z p Z p

2

2

8.7, 0.001 0.245(0.085)( 2.9, 0.005)

ˆ 0.080(0.16)

ˆ 0.566(0.013) 0.566(0.013)u

e

Z p Z p

Inference changes, under single level model we infer boys do better in single sex schools.

Single level models which ignore clustering will give rise to mis-estimated precision, particularly for contextual effects. Why?

Page 7: Contextual effects In the previous sections we found that when regressing pupil attainment on pupil prior ability schools vary in both intercept and slope.

Mis-estimated precision

In this data set we have 4059 pupils in 65 schools.

We therefore only have 65 independent bits of information with which to identify the school effects. The standard errors calculated for the single level model assume we have 4059 bits of information.

With level 1 predictors we also get mis-estimated precision because the clustering at higher levels induces correlations between individuals in the same group, so we also have less than 4059 bits of information. However, the problem is typically far less severe. Indeed in the above analysis there are no differences between the standard errors for the coefficients of level 1 predictor variable prior ability between the single level and random intercept models.

Page 8: Contextual effects In the previous sections we found that when regressing pupil attainment on pupil prior ability schools vary in both intercept and slope.

Why not just include dummy variables for each school in the ‘single’ level model

This would be the equivalent of fitting an analysis of covariance model.

Unfortunately this will not work. We only have 65 pieces of information at the school level and if we use this up by fitting 65 dummy variables we can add no more variables at the school level. So we can not add the school gender dummies.

Multilevel modelling provides a richer and more accurate exploratory framework for modelling contextual effects.

We get the right standard errors

We can see how much of the higher level variation was explained by the contextual effects and how much remains.

Page 9: Contextual effects In the previous sections we found that when regressing pupil attainment on pupil prior ability schools vary in both intercept and slope.

Within group, between group and contextual effects of for level 1 predictors

5 1 income ( 2) av_income

~ (0,2)

ij ij j j ij

ij

y u e

e N

We will simulate a small data set with 100 individuals from four groups, for the sake of argument lets say that our response is happiness, we have a predictor variable that is income and the groups are 4 different countries. Lets simulate the mean income in each country as 2,4,6,8. We then simulate our response as

Note that this model does not include a country level random effect. Therefore the only differences between country happiness levels are produced by differing incomes in the countries.

Often contextual variables are constructed by aggregating level 1 predictors, country level income, family level aggression etc

Page 10: Contextual effects In the previous sections we found that when regressing pupil attainment on pupil prior ability schools vary in both intercept and slope.

Fitting a regression model ignoring average income

0 1

2

0

1

~ (0, )

ˆ 3.577(0.680)

ˆ 0.770(0.122)

i i i

i e

happiness income e

e N

And we might conclude as income rises happiness reduces

Page 11: Contextual effects In the previous sections we found that when regressing pupil attainment on pupil prior ability schools vary in both intercept and slope.

Including the average income variable0 1 2

2

0

1

2

happiness income av_income

~ (0, )

ˆ 5.772(0.492)

ˆ 1.128(0.122)

ˆ 2.332(0.207)

ij ij j ij

ij e

e

e N

Now we have a different picture. Within all countries the relationship between income and happiness is positive. This is the within country slope(1.128)

Recall the country average incomes are {2,4,6,8}, which gives intercepts of {1.13,-3.51, -8.15, -12.8}

However the intercept for country j is 5.772 - 2.32 av_incomej

-2.32 is the contextual effect.

Now within all countries we have a positive relationship between income and happiness, however people in richer countries tend to be less happy than poorer ones.

Page 12: Contextual effects In the previous sections we found that when regressing pupil attainment on pupil prior ability schools vary in both intercept and slope.

What about the between group effect?

The between group effect is the slope of the regression of the country mean for happiness on the country mean for income.

We have identified the within group and contextual effects of the income predictor.

That is the slope of the regression line through the four red points and is -1.20

within group = 1.128

contextual = -2.332

between group = -1.204

Notice that the between group = the within group + the contextual

B = W + C

-1.204=1.128+(-1.204)

Or C = B – W that is the contextual effect is the the difference of the between and within regressions

Page 13: Contextual effects In the previous sections we found that when regressing pupil attainment on pupil prior ability schools vary in both intercept and slope.

Examples of different contextual effects

W=1,B= -1,C=-2 W = 1, B=1,C=0 W=1,B=3,C=2

Contextual effect pulls down intercept as av_income increases

Contextual effect 0 so intercept unchanged as av_income increases

Contextual effect pushes up intercept as av_income increases

Page 14: Contextual effects In the previous sections we found that when regressing pupil attainment on pupil prior ability schools vary in both intercept and slope.

Why does B=W+C?

0 1 2 1 2

0 1 2

0 1 2

where W= and C=

Now to derive the between group slope from this model we must

average the left and right hand side to the group level which gives

( )

ij ij j ij

j j j j

j

y x x e

y x x e

y

1 2Thus B=( )

j jx e

Page 15: Contextual effects In the previous sections we found that when regressing pupil attainment on pupil prior ability schools vary in both intercept and slope.

Group mean centering of a level 1 predictor

0 1 2( )ij ij j j ijy x x x e

If we…

Something interesting happens. In our example this corresponds to

0 1 2

0

1

2

happiness (income av_income ) av_income

ˆ 5.772(0.492)

ˆ 1.128(0.122)

ˆ 1.204(0.148)

ij ij j j ije

The intercept and within slope remain unchanged , but 2 now estimates the between group coefficient not the contextual coefficient for income…

Page 16: Contextual effects In the previous sections we found that when regressing pupil attainment on pupil prior ability schools vary in both intercept and slope.

Comparison of uncentered and group mean centered level 1 income predictor

0 1

2

0

1

2

1

2

happiness (income av_income )

av_income

ˆ 5.772(0.492)

ˆ 1.128(0.122)

ˆ 1.204(0.148)

ˆ 1.128

ˆ 1.204

2.332

ij ij j

j ije

W

B

C B W

0 1

2

0

1

2

1

2

happiness income

av_income

ˆ 5.772(0.492)

ˆ 1.128(0.122)

ˆ 2.332(0.207)

ˆ 1.128

ˆ 2.332

1.204

ij ij

j ije

W

C

B W C

Note that if you grand mean centre income then 2 remains the contextual coefficient – ie behaves in the same way as the uncentered case

Page 17: Contextual effects In the previous sections we found that when regressing pupil attainment on pupil prior ability schools vary in both intercept and slope.

With group mean centering why is 2 the between group effect

0 1 2 1

0 1 2

0 2

2

( ) where W=

Now we average average the left and right hand side to the group level

( )

Thus B=

ij ij j j ij

j j j j j

j j j

y x x x e

y x x x e

y x e

Page 18: Contextual effects In the previous sections we found that when regressing pupil attainment on pupil prior ability schools vary in both intercept and slope.

And now to some real data..

0 1

0 0 0

1 1 1

20 0

21 01 1

0

1

hedonism income

~ (0, )

ˆ 0.187(0.059)

ˆ 0.0431(0.008)

0.069

0.004 0.001

ij j j ij ij

j j

j j

j uu u

j u u

u

e

u

u

uN

u

Consider the random slopes model on the hedonism data where we regress hedonism on income

Note income centered around grand mean of 6.

Page 19: Contextual effects In the previous sections we found that when regressing pupil attainment on pupil prior ability schools vary in both intercept and slope.

Adding contextual effect for income0 1 2

0 0 0

1 1 1

20 0

21 01 1

0

1

2

2

hedonism income av_income

~ (0, )

ˆ 0.278(0.216)

ˆ 0.043(0.008)

ˆ 0.016(0.035)

0.066

0.009 0.001

0.876

ij j j ij j ij

j j

j j

j uu u

j u u

u

e

e

u

u

uN

u

The contextual effect is positive but non-significant.

If we obtain model predictions for a low(3.5) and high(8) average income country we obtain

Low = (-0.278 + 0.016 3.5) + 0.043 income

= -0.222 + 0.043 incomeHigh = (-0.278 + 0.016 8) + 0.043 income= -0.150 + 0.043 income

Thus the positive contextual effect means countries with higher average incomes have higher intercepts and this has reduce the intercept variation by a small amount from 0.069 to 0.066

Page 20: Contextual effects In the previous sections we found that when regressing pupil attainment on pupil prior ability schools vary in both intercept and slope.

Cross-level interactions

The fixed part of the previous model assumes the within country income slopes do not change as functions of country level variables. So the within country lines for low and high income countries are parallel.

It may be that the with country income slopes may change as a function of the contextual variable av_income.

We can test this assumption by allowing the within country income slopes to change as a function of av_income that is fit an interaction between income and av_income

Page 21: Contextual effects In the previous sections we found that when regressing pupil attainment on pupil prior ability schools vary in both intercept and slope.

Cross level interaction

0 1 2 3

0 0 0

1 1 1

20 0

21 01 1

0

1

2

3

hedonism income av_income income.av_income

~ (0, )

ˆ 0.465(0.223)

ˆ 0.123(0.025)

ˆ 0.049(0.037)

ˆ 0.0137(0.004)

0.064

ij j j ij j ij ij

j j

j j

j uu u

j u u

u

e

u

u

uN

u

2

0.002 0.0006

0.876e

The cross level interaction is negative and statistically significant. The model predictions for countries with low and high average incomes are now

Low = (-0.465 + 0.049 3.5) + (0.123 -0.137 3.5) income

= -0.29 + 0.076 incomeHigh = (-0.465 + 0.049 8) + (0.123 -0.137 8) income= -0.08 +0.016 income

Page 22: Contextual effects In the previous sections we found that when regressing pupil attainment on pupil prior ability schools vary in both intercept and slope.

Interpreting the graph

At low levels of individual income people in rich countries are more hedonistic. As individual income rises the rich-poor country differential diminishes

For what incomes is the rich country-poor country gap significant?

Page 23: Contextual effects In the previous sections we found that when regressing pupil attainment on pupil prior ability schools vary in both intercept and slope.

Contextual effects explaining level 2 variance

0

0 0 0

20

1 1

1 1 1

21 0 1

0

1

~ (0, )

j ij

j j

ij

u u

u

j ij

j j

j u

j u

x

u

u

e

u

Nu

y

3 2 1

1 1 1

21

0 2 21

0 0 0

20 0

1

1

01

~ (0

(

, )

)ij

j

ij j ij j ij

j j

j u

j

u u

u

j

j u

x x

u

u

y x x e

u

uN

Given a random slope model Contextual variables explain level 2 variation in the intercept and cross-level interactions of contextual variables with x1 explain level variability in the slope coefficient

0

0 0 2

1 1

1 1

2 0

2

3 2 1

1

0

011

0

2~ (0, )

j ij

j j

j ij

j j j

j

j

j

uu u

u

ij

u

x

x

y

N

u

u

u

u

e

x

This can be seen by re-arranging

Page 24: Contextual effects In the previous sections we found that when regressing pupil attainment on pupil prior ability schools vary in both intercept and slope.