11.07.2015 Views

statisticalrethinkin..

statisticalrethinkin..

statisticalrethinkin..

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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

356 14. MULTILEVEL MODELS IIR code14.3variance-covariance matrixes in this book, this is sometimes nearly true, but oen not evenclose to true.is is what the model looks like:A ij ∼ Binomial(p ij , n ij )logit p ij = α + α j + (β + β j )m ij( )(( )αj0∼ MVNormal , SRSβ j 0)[likelihood][linear model][joint prior for varying effects]α ∼ Normal(0, 10) [prior for α]β ∼ Normal(0, 1) [priot for β](σ α , σ β ) ∼ Cauchy(0, 2.5) [prior for each σ]R ∼ LKJCorr(2)[prior for correlation matrix]e symbol m ij indicates the value of male for the i-th row of the j-th department. It ismultiplied by the sum β + β j , which is a total slope defined by both a value common toall departments, β, and a value unique to each department, β j . Just as with the varyingintercepts α j , the varying slopes β j are drawn from a multivariate normal distribution, andthe distribution of both the varying intercepts and slopes is defined by the third line.So how are you supposed to read that third line? is mess is what is needed to define ajoint prior for the varying intercepts, α j , and varying slopes, β j . Now we have two standarddeviation parameters, one governing each type of varying effect, so I have relabeled them σ αand σ β to indicate the batch of effects each describes. But these two normal distributionsare also possibly correlated with one another, and their correlation is measured by ρ (“rho”).e final line above reads: sample pairs of α j and β j values, one pair for each department j,from a bivariate normal distribution with variance-covariance matrix defined by the variancesσα 2 and σβ 2 and correlation ρ.ink of these α j and β j values as being analogous to the sets of samples you drew fromthe naive posterior in previous chapters. Using the variance-covariance matrix of the posterior(vcov), you could define a multivariate normal distribution and sample random numbersfrom. e values across columns in the resulting table had a special correlation structure.Likewise, these varying intercepts and slopes will have a special correlation structure,defined by ρ. e notation is a bit weird at first, but you’ll get used to it, aer a few moreexamples.To estimate this model, use:m14.2

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

Saved successfully!

Ooh no, something went wrong!