-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPLSquared_DataAnalysis.rmd
More file actions
171 lines (125 loc) · 5.5 KB
/
PLSquared_DataAnalysis.rmd
File metadata and controls
171 lines (125 loc) · 5.5 KB
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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
---
title: "PLSquared- Basic Analysis"
author: "Arun Sharma"
date: "12/15/2019"
output: html_document
---
```{r global_options, include=TRUE}
#knitr::opts_chunk$set(echo=FALSE, warning=FALSE, message=FALSE)
```
```{r setup, include=FALSE}
# Loading libraries
library(tidyverse)
library(data.table)
library(ggplot2)
```
```{r}
#loading data for the year 17-18
Fall1718 <- fread("2018_NWEA/NWEA Fall 2017-hashed.csv")
Winter1718 <- fread("2018_NWEA/NWEA_Winter_2017-2018-hashed.csv")
Spring1718 <- fread("2018_NWEA/NWEA_Spring_2017-2018-hashed.csv")
#loading data for the year 19-18
Fall1819 <- fread("2019_NWEA/NWEA Fall 2018-hashed.csv")
Winter1819 <- fread("2019_NWEA/NWEA_Winter_2018-2019-hashed.csv")
Spring1819 <- fread("2019_NWEA/NWEA_Spring_2018-2019-hashed.csv")
```
```{r}
#merging both years to get thecommulative data
Complete_1718 <- rbind(Fall1718,Winter1718,Spring1718)
Complete_1819 <- rbind(Fall1819,Winter1819,Spring1819)
```
```{r}
#playing with data
#summary(Complete_1718)
```
```{r}
#Summarising the data by student performance
Summary_Student_1718 <- Complete_1718 %>%
group_by(StudentID, TermName, Discipline) %>%
summarise(count = n(), avg.RIT = mean(TestRITScore), percentile = mean(TestPercentile))
head(Summary_Student_1718)
```
```{r}
Summary_school_1718 <- Complete_1718 %>%
group_by(SchoolName, TestName) %>%
summarise(count = n(), avg.RIT = mean(TestRITScore), percentile = mean(TestPercentile))
Summary_school_1718
```
```{r, fig.width= 10, fig.height=10}
#removing the middle school, comparing only elementary schools, cleaning with little data
Elementaryschools_1718 <- Complete_1718[!Complete_1718$SchoolName %in% "Elizabeth Forward Middle School"&
!Complete_1718$TestName %in% "Screening: Math 2-5 PA 2013" &
!Complete_1718$TestName %in% "Screening: Reading 2-5 PA 2013" &
!Complete_1718$TestName %in% "Growth: Language 2-12 PA 2013" ,]
Elementaryschools_1718 <- Elementaryschools_1718 %>%
filter(!is.na(TestRITScore))
#Summarising school wise
Box_plot_schools <- Elementaryschools_1718 %>%
group_by(SchoolName) %>%
ggplot(aes(x= SchoolName, y = TestRITScore, fill = SchoolName))+
facet_wrap("TestName")+
geom_boxplot() +
theme(axis.text.x = element_text(angle = 60, hjust =1, vjust =1))
Box_plot_schools
```
```{r, fig.width=10, fig.height=10}
Elementary.maths.2_5_1718 <- Complete_1718[Complete_1718$TestName %in% "Growth: Math 2-5 PA 2013",]
Elementary.maths.2_5_1718.summary <- Elementary.maths.2_5_1718 %>%
group_by(SchoolName) %>%
summarise( count = n(), avg.rit.score = mean (TestRITScore), lower = t.test(TestRITScore, mu =0)$conf.int[1], upper = t.test(TestRITScore, mu =0)$conf.int[2])
Elementary.maths.2_5_1718.summary %>%
ggplot(aes( x= SchoolName, y= avg.rit.score, fill = SchoolName)) +
geom_bar(stat = "identity") +
geom_errorbar(aes(ymin = lower, ymax = upper),
width =0.4,
position = position_dodge(0.9)) +
coord_cartesian(ylim = c(175,215)) +
theme(axis.text.x = element_text(angle = 60, hjust =1, vjust =1)) +
ggtitle("Growth : Math 2-5 PA 2013 Scores distribution by schools")
#anova for variation with in Math score across schools
aov(data = Elementary.maths.2_5_1718, TestRITScore ~ SchoolName)
```
```{r}
demographicInfo <- fread(input = "Studnet ID_IEP_Econ_Ethn_EF-hashed.csv")
names(demographicInfo)[1] <- names(Summary_Student_1718)[1]
Summary_Student_1718 <- merge(Summary_Student_1718, demographicInfo)
# combining the entire data with demographic characteristics
Complete_1718 <- merge(Complete_1718 , demographicInfo)
Complete_1819 <- merge(Complete_1819, demographicInfo)
```
```{r}
#distribution by schools
demographic.distribution <- Complete_1718 %>%
count(SchoolName, Ethnicity) %>%
mutate(prop = prop.table(n))
demographic.distribution %>%
ggplot(aes( x= SchoolName, y = n, fill = Ethnicity)) +
geom_bar(stat= "identity", position = "dodge") +
theme(axis.text.x = element_text(angle = 60, hjust =1, vjust =1))
```
```{r, fig.width= 10, fig.height=10}
#Ethnicity wise RIT scores
Elementaryschools.demo_1718 <- Complete_1718[!Complete_1718$SchoolName %in% "Elizabeth Forward Middle School"&
!Complete_1718$TestName %in% "Screening: Math 2-5 PA 2013" &
!Complete_1718$TestName %in% "Screening: Reading 2-5 PA 2013" &
!Complete_1718$TestName %in% "Growth: Language 2-12 PA 2013" ,]
boxplot.demo_1718 <- Elementaryschools.demo_1718 %>%
group_by(SchoolName,TestName, Ethnicity) %>%
ggplot( aes( x = Ethnicity, y = TestRITScore, fill = Ethnicity)) +
geom_boxplot() +
facet_wrap(vars(SchoolName, TestName)) +
ggtitle("BoxPlots depicting average RIT scores for different races across Schools")
boxplot.demo_1718
```
```{r, fig.width=10, fig.height=10}
Elementaryschools.demo_1718 <- mutate(
Elementaryschools.demo_1718, EconDis = recode_factor(Elementaryschools.demo_1718$EconDis, `1` ="Not Ecnonmically Disadvantage", `0` = "Ecnonmically Disadvantage"))
boxplot.demo_1718 <- Elementaryschools.demo_1718 %>%
group_by(SchoolName,TestName, EconDis) %>%
ggplot( aes( x = EconDis, y = TestRITScore, fill = EconDis)) +
geom_boxplot() +
facet_wrap(vars(SchoolName, TestName)) +
ggtitle("BoxPlots depicting average RIT scores for different Econmic Disadvantageous Kids across Schools")+
theme(axis.text.x = element_text(angle = 60, hjust =1, vjust =1))
boxplot.demo_1718
```