forked from proback/BeyondMLR
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path04-temp.Rmd
118 lines (94 loc) · 8.8 KB
/
04-temp.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
---
title: "Chapter 8"
subtitle: "Introduction to Multilevel Models"
output:
pdf_document:
number_sections: yes
html_document: default
---
```{r,include=F}
if(knitr::is_html_output()){options(knitr.table.format = "html")} else {options(knitr.table.format = "latex")}
```
# Two Level Longitudinal Data {#ch-lon}
## Learning objectives
After finishing this chapter, you should be able to:
- Recognize longitudinal data as a special case of multilevel data, with time at Level One.
- Consider patterns of missingness and implications of that missing data on multilevel analyses.
- Apply exploratory data analysis techniques specific to longitudinal data.
- Build and understand a taxonomy of models for longitudinal data.
- Interpret model parameters in multilevel models with time at Level One.
- Compare models, both nested and not, with appropriate statistical tests and summary statistics.
- Consider different ways of modeling the variance-covariance structure in longitudinal data.
```{r load_packages9, message = FALSE}
# Packages required for Chapter 9
library(GGally)
library(data.table)
library(Hmisc)
library(mice)
library(lattice)
library(nlme)
library(reshape2)
library(MASS)
library(mnormt)
library(lme4)
library(gridExtra)
library(knitr)
library(kableExtra)
library(tidyverse)
```
## Case study: Charter schools {#cs:charter}
Charter schools were first introduced in the state of Minnesota in 1991 [@CharterSchools]. Since then, charter schools have begun appearing all over the United States. While publicly funded, a unique feature of charter schools is their independence from many of the regulations that are present in the public school systems of their respective city or state. Thus, charters will often extend the school days or year and tend to offer non-traditional techniques and styles of instruction and learning.
One example of this unique schedule structure is the KIPP (Knowledge is Power Program) Stand Academy in Minneapolis, MN. KIPP stresses longer days and better partnerships with parents, and they claim that 80\% of their students go to college from a population where 87\% qualify for free and reduced lunch and 95\% are African-American or Latino [@KIPP]. However, the larger question is whether or not charter schools are out-performing non-charter public schools in general. Because of the relative youthfulness of charter schools, data has just begun to be collected to evaluate the performance of charter versus non-charter schools and some of the factors that influence a school's performance. Along these lines, we will examine data collected by the Minnesota Department of Education for all Minnesota schools during the years 2008-2010.
Comparisons of student performance in charter schools versus public schools have produced conflicting results, potentially as a result of the strong differences in the structure and population of the student bodies that represent the two types of schools. A study by the Policy and Program Studies Service of five states found that charter schools are less likely to meet state performance standards than conventional public schools [@DepartmentOfEducation2004]. However, @Witte2007 performed a statistical analysis comparing Wisconsin charter and non-charter schools and found that average achievement test scores were significantly higher in charter schools compared to non-charter schools, after controlling for demographic variables such as the percentage of white students. In addition, a study of California students who took the Stanford 9 exam from 1998 through 2002 found that charter schools, on average, were performing at the same level as conventional public schools [@Buddin2005]. Although school performance is difficult to quantify with a single measure, for illustration purposes in this chapter we will focus on that aspect of school performance measured by the math portion of the Minnesota Comprehensive Assessment (MCA-II) data for 6th grade students enrolled in 618 different Minnesota schools during the years 2008, 2009, and 2010 [@MNDepartmentOfEducation]. Similar comparisons could obviously be conducted for other grade levels or modes of assessment.
As described in @Green2003, it is very challenging to compare charter and public non-charter schools, as charter schools are often designed to target or attract specific populations of students. Without accounting for differences in student populations, comparisons lose meaning. With the assistance of multiple school-specific predictors, we will attempt to model sixth grade math MCA-II scores of Minnesota schools, focusing on the differences between charter and public non-charter school performances. In the process, we hope to answer the following research questions:
- Which factors most influence a school's performance in MCA testing?
- How do the average math MCA-II scores for 6th graders enrolled in charter schools differ from scores for students who attend non-charter public schools? Do these differences persist after accounting for differences in student populations?
- Are there differences in yearly improvement between charter and non-charter public schools?
## Initial Exploratory Analyses {#exploratoryanalysis}
### Data organization {#data}
Key variables in `chart_wide_condense.csv` which we will examine to address the research questions above are:
- `schoolid` = includes district type, district number, and school number
- `schoolName` = name of school
- `urban` = is the school in an urban (1) or rural (0) location?
- `charter` = is the school a charter school (1) or a non-charter public school (0)?
- `schPctnonw` = proportion of non-white students in a school (based on 2010 figures)
- `schPctsped` = proportion of special education students in a school (based on 2010 figures)
- `schPctfree` = proportion of students who receive free or reduced lunches in a school (based on 2010 figures). This serves as a measure of poverty among school families.
- `MathAvgScore.0` = average MCA-II math score for all sixth grade students in a school in 2008
- `MathAvgScore.1` = average MCA-II math score for all sixth grade students in a school in 2009
- `MathAvgScore.2` = average MCA-II math score for all sixth grade students in a school in 2010
This data is stored in WIDE format, with one row per school, as illustrated in Table \@ref(tab:table1chp9).
```{r, include=FALSE, warning=FALSE}
#Getting started
chart.wide = read_csv("data/chart_wide_condense.csv")
```
```{r table1ch9, echo=FALSE, warning=TRUE}
table1chp9 <- head(chart.wide[2:11])
kable(table1chp9, booktabs=T,
caption = "The first six observations in the wide data set for the Charter Schools case study.") %>%
kable_styling(bootstrap_options = c("striped")) %>%
# column_spec(column = 1:2, width = "18em; min-width: 15em;")
kable_styling(latex_options = "scale_down")
#ifelse(knitr::is_html_output(),
# kab1chp9 %>% scroll_box(width="100%"), kab1chp9)
```
```{r table2chp9,echo=FALSE}
table2chp9 <- md.pattern(chart.wide[c(5,9,10,11)], plot=FALSE)
kable(table2chp9, booktabs=T,
caption="A frequency table of missing data patterns. The number of schools with a particular missing data pattern are listed in the left column; the remaining columns of 0's and 1's describe the missing data pattern, with 0 indicating a missing value. Some covariates that are present for every school are not listed. The bottom row gives the number of schools with missing values for specific variables; the last entry indicates that 121 total observations were missing.") %>%
kable_styling(latex_options = "scale_down")
```
```{r, include=FALSE}
Predictor <- c("Intercept (initial Status)", "Base (intercept for predicting int term)", "Peer behavior", "Black Ethnicity", "White/Other ethnicity", "Parenting", "Black Ethnicity X Parenting", "White/Other ethnicity X Parenting", "...Slope(change)", "...Base(intercept for predicting slope term)", "...Peer behavior", "...Black ethnicity", "...White/Other ethnicity", "...Parenting", "...Black Ethnicity X Parenting", "...White/Other ethnicity X Parenting")
Gammafiller <- c(" ","-.219",".252**",".671*",".149",".076","-.161+","-.026"," ",".028","-.011*","-.132*","-.059","-.015+","-.048**",".016")
SE <- c(" ", ".160",".026",".289",".252",".050",".088",".082"," ",".030",".005",".054",".046",".009",".017",".015")
```
```{r, table4chp9, echo=FALSE}
table4chp9 <- data.frame(Predictor, Gammafiller, SE)
colnames(table4chp9) <- c("Predictor","Coefficient", "SE")
kable(table4chp9, booktabs=T, escape=F,
caption="A portion of Table 2: Results of Hierarchical Linear Modeling Analyses Modeling Gang Involvement from Walker-Barnes and Mason (2001). These columns focus on the parenting behavior of psychological control.") %>%
kable_styling(latex_options = "scale_down") %>%
row_spec(c(1,9), bold=T) %>%
add_footnote("Table reports values for coefficients in the final model with all variables entered. * p<.05; ** p<.01; + p<.10", notation="alphabet")
```