-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathATI_SGP_2015_PrePost.R
64 lines (45 loc) · 1.76 KB
/
ATI_SGP_2015_PrePost.R
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
#########################################################
###
### Calculate EOCT SGPs for ATI for Pre-Post test 2014-15
###
##########################################################
### Load SGP Package
require(SGP)
require(data.table)
### Load ATI data
ATI_Data_LONG <- fread('Data/Base_Files/_ASU_2014-15_PreMYPost_2015-08-18.csv')
## Fix the DATE format and create new variable with SGP naming convention
my.tmp.split <- strsplit(ATI_Data_LONG$TestDate, " ")
my.tmp.split <- sapply(my.tmp.split, function(x) strsplit(x[[1]][1], "/"))
# my.tmp.split <- strsplit(ATI_Data_LONG$TestDate, "/")
ATI_Data_LONG[, DATE := as.Date(sapply(seq_along(my.tmp.split), function(x) paste(c(my.tmp.split[[x]][3], my.tmp.split[[x]][1:2]), collapse = "-")))]
## Fix the YEAR variable (name and mid-year format)
setnames(ATI_Data_LONG, "Year", "YEAR")
ATI_Data_LONG[which(YEAR=='2014-2015.2'), YEAR := '2014_2015.2']
### Load EOCT configurations
source("SGP_CONFIG/2015/READING.2015_PrePost.config")
source("SGP_CONFIG/2015/MATHEMATICS.2015_PrePost.config")
ATI.config <- c(
READING.2015.config,
MATHEMATICS.2015.config)
####################################################################################
###
### SGP Analyses
###
####################################################################################
ATI_SGP <- abcSGP(
ATI_Data_LONG,
steps=c("prepareSGP", "analyzeSGP", "combineSGP"),
sgp.config=ATI.config,
sgp.percentiles=TRUE,
sgp.projections=FALSE,
sgp.projections.lagged=FALSE,
sgp.percentiles.baseline=FALSE,
sgp.projections.baseline= FALSE,
sgp.projections.lagged.baseline=FALSE,
SGPt=TRUE,
simulate.sgps=FALSE)
### Save results
save(ATI_SGP, file="Data/ATI_SGP_PrePost.Rdata")
### Output Long file
outputSGP(ATI_SGP, output.type="LONG_Data")