240 likes | 479 Views
Multilevel Modeling using Stata. Andrew Hicks CCPR Statistics and Methods Core. Workshop based on the book: Multilevel and Longitudinal Modeling Using Stata (Second Edition) by Sophia Rabe-Hesketh Anders Skrondal. Within-Subject Dependence : We can predict occasion 2 measurement if
E N D
Multilevel Modeling using Stata Andrew Hicks CCPR Statistics and Methods Core Workshop based on the book: Multilevel and Longitudinal Modeling Using Stata (Second Edition) by Sophia Rabe-Hesketh Anders Skrondal
Within-Subject Dependence: We can predict occasion 2 measurement if we know the subject’s occasion 1 measurement. Within-Subject Dependence Between-Subject Heterogeneity: Large differences between subjects (compare subjects 9 and 15) Within-subject dependence is due to between-subject heterogeneity
Measurement of subject ion occasion j Population Mean Residuals (error terms) Independent over subjects and occasions Standard Regression Model { { { { Clearly ignores information about within-subject dependence
Random Intercept: deviation of subject j’s mean from overall mean Variance Component Model Within-subject residual: deviation of observation ifrom subject j’s mean
Random Intercept: deviation of subject j’s mean from overall mean Variance Component Model Within-subject residual: deviation of observation ifrom subject j’s mean
Random Intercept: deviation of subject j’s mean from overall mean Within-subject residual: deviation of observation ifrom subject j’s mean Variance Component Model
Proportion of Total Variance due to subject differences: = = Intraclass Correlation: within cluster correlation Variance Component Model =
Since every subject has a different effect we can think of subjects as categorical explanatory variables. Since the effects of each subject is random, we have been using a random effect model: , What if we want to fix our model so that each effect is for a specific subject? Then we would use a fixed effect model: , Random or Fixed Effect? .xtregwm, fe
random effect model: if the interest concerns the population of clusters “generalize the potential effect” i.e. nurse giving the drug fixed effect model: if we are interest in the “effect” of the specific clusters in a particular dataset “replicable in life” i.e. the actual drug Random or Fixed Effect?
without covariates: Random Intercept Model with Covariates
with covariates: Random Intercept Model with Covariates random parameter not estimated with fixed parameters but whose variance is estimated with variance of
occurs when between-cluster relationships differ substantially from within-cluster relationships. • Can be caused by cluster-lever confounding • For example, mothers who smoke during pregnancy may also adopt • other behaviors such as drinking and poor nutritional intake, or have lower • socioeconomic status and be less educated. These variables adversely affect • birthweight and have not be adequately controlled for. In these cases the • covariate is correlated with the error term. (endogeneity) • Because of this, the between-effect may be an overestimate of the • true effect. Ecological Fallacy • In contrast, for within-effects each mother serves as her own control, • so within mother estimates may be closer to the true causal effect.
Use the Hausman test to compare two alternative estimators of How to test for endogeneity?
We’ve already considered random intercept models where the intercept is allowed to vary over clusters after controlling for covariates. What if we would also like the coefficients (or slopes) to vary across clusters? Models the involve both random intercepts and random slopes are called Random Coefficient Models Random-coefficient model
Random Intercept Model: Random Coefficient Model: cluster-specific random intercept Random-coefficient model cluster-specific random slope