11.07.2015 Views

statisticalrethinkin..

statisticalrethinkin..

statisticalrethinkin..

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

222 7. INTERACTIONSlog GDP year 20006 7 8 9 10 11not AfricaAfrica0 1 2 3 4 5 6Terrain Ruggedness IndexFIGURE 7.3. Including a dummy variable forAfrican nations has no effect on the slope.African nations are shown in blue. Non-African nations are shown in gray. Regressionmeans for each subset of nations are shownin corresponding colors, along with 95% percentileintervals shown by shading.where y is log(rgdppc_2000), A is cont_africa, and r is rugged. As you’ve done sinceChapter 4, the linear model is built by replacing the parameter µ in the top line, the likelihood,with a linear equation that is a function of data and new parameters such as α andβ.We’ll build interactions by extending this strategy. Now you want to allow the relationshipbetween y and r to vary as a function of A. Within the model, this relationship ismeasured by the slope β r . Following the same strategy of replacing parameters with linearmodels, the most straightforward way to make β r depend upon A is just to define the slopeβ r as a linear model itself, one that includes A. is approach results in this likelihood (you’llalso need priors, which we’ll add in a bit):y i ∼ Normal(µ i , σ)[likelihood]µ i = α + γ i r i + β A A i [linear model of µ]γ i = β r + β Ar A i[linear model of slope]is is the first model with two linear models, but its structure is the same as every Gaussianmodel you’ve already fit in this book. So you don’t need to learn any new tricks for fittingthis model to data. e tricks lie entirely in interpreting it.e first line above is the same Gaussian likelihood you’ve been using since Chapter 4.e second line is the same kind of additive definition of µ i that you’ve seen many times.e third line is the new bit. e new symbol γ i is just a placeholder for the linear functionthat defines the slope between GDP and ruggedness. We use “gamma” (γ) here, because itfollows “beta” (β) in the Greek alphabet. e equation for γ i defines the interaction betweenruggedness and African nations. It is a linear interaction effect, because the equation γ i is afamiliar linear model.By defining the relationship between GDP and ruggedness in this way, you are explicitlymodeling the hypothesis that the slope between GDP and ruggedness depends—is conditional—uponwhether or not a nation is in Africa. e parameter β Ar defines the strengthof this dependency. If you set β Ar = 0, then you get the previous model back. If insteadβ Ar > 0, then African nations have a more positive slope between GDP and ruggedness. Ifβ Ar < 0, African nations have a more negative slope. For any nation not in Africa, A i = 0and so the interaction parameter β Ar has no effect on prediction for that nation. Of courseyou are going to compute the posterior distribution for β Ar from the data. But once you

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!