110 likes | 141 Views
Mixed Linear Models. An Introductory Tutorial. Course Objectives. By the end of this class you will be able to: Conceptually understand the Mixed Model methodology Read and critique the methodology in grants and papers Analyze clustered data with mixed models
E N D
Mixed Linear Models An Introductory Tutorial
Course Objectives • By the end of this class you will be able to: • Conceptually understand the Mixed Model methodology • Read and critique the methodology in grants and papers • Analyze clustered data with mixed models • Analyze longitudinal data with mixed models • Understand how to determine fixed effects • Understand how to determine random effects and covariance structures • Test custom hypotheses (I.e. linear trend, time 1 – time 3 contrasts)
The Usual Linear Models • Remember Linear Regression? • Linear models describe how the values of one set of variables (the predictors) relate to the value of another variable (the outcome) • Linear models assume a linear relationship between the predictors and the outcome.
The Usual Linear Models • Some preliminary notation: • i : An index of the subjects the goes from 1 to N • : The outcome variable • : A predictor variable • : A continuous predictor variable (i.e. Age, PANSS score) • : A categorical predictor variable coded 0,1 (i.e. Gender, Treat) • : An error term. This is the left over variation unaccounted for by the model • : A model parameter
The Usual Linear Models Everything is a linear model: Multiple regression, N-way ANOVAs, ANCOVAs, ANOVAs, T-tests, and Simple regression How to interpret the coefficients: For every 1 point increase in X, on average, there is a point increase in Y. T-test: Simple regression:
The Usual Linear Models • Important Assumptions about the errors: • The errors ( ) are normally distributed. - This is a weak assumption. As our sample gets large, this assumption does not matter. • Homoskedasticity: Equality of variance - The errors all have to have the same variance. No fanning, or groups with larger variance. • The errors ( ) are all independent. • The sampling design can not introduce dependence in the data. Subjects can not be sampled longitudinally, or in clusters Mixed linear models are one way to analyze data with dependant errors.
A cluster sampled dataset • The PICSES program at SDSU: • PICSES workers selected various teachers in San Diego, and sampled all of the children in those classes. • Children were asked about their feelings about science and scientists. • We would expect that children in the same classroom would exhibit similar traits, as they have intimate interaction, and are from similar neighborhoods.
The Random Intercept Mixed Model Teachers are selected randomly from a population of San Diego teachers: So, if there are m teachers indexed by j, each with n students j : An index of teachers from 1,2,…,m i : An index of students from 1,2,…,n Are boys and girls different with regard to their attitude towards science? Naive method: T-test Part of the error term ( ) in this model can be attributed to the teachers, and part to the students, so lets partition out the variance attributable to the teachers into another term ( ). We Assume that the random variation due to teachers is normal, and that the errors are normal:
Other random effects Random slope Example: If subjects in a group therapy trial are split into classes of size 10 with different therapists, we would expect that group dynamics, and therapist would effect how well the group therapy treatment worked. Thus treatment is a random effect, dependant on which therapist is drawn from the population of all therapists to teach the class, and which peers are drawn from the population to take part in the class. Outcome at last time point Intercept Treatment Effect Random effect of Treatment Random intercept Individual Error