-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUtah_SGP_2021_PART_A.R
62 lines (52 loc) · 2.17 KB
/
Utah_SGP_2021_PART_A.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
################################################################################
### ###
### Utah COVID Skip-year SGP analyses for 2021 ###
### ###
################################################################################
### Load packages
require(SGP)
require(data.table)
require(SGPmatrices)
### Load data
load("Data/Utah_SGP.Rdata")
load("Data/Utah_Data_LONG_2021.Rdata")
### Add Baseline matrices to SGPstateData
SGPstateData <- addBaselineMatrices("UT", "2021")
# load("Data/UT_Baseline_Matrices.Rdata")
# SGPstateData[["UT"]][["Baseline_splineMatrix"]][["Coefficient_Matrices"]] <- UT_Baseline_Matrices
### Read in SGP Configuration Scripts and Combine
source("SGP_CONFIG/2021/PART_A/ELA.R")
source("SGP_CONFIG/2021/PART_A/SCIENCE.R")
source("SGP_CONFIG/2021/PART_A/MATHEMATICS.R")
UT_Config_2021_PartA <- c(
ELA_2021.config,
SCIENCE_2021.config,
MATHEMATICS_2021.config,
SEC_MATH_I_2021.config
)
### Parallel Config
## Make NULL if using Windows! `parallel.config <- NULL`
parallel.config <- list(BACKEND="PARALLEL",
WORKERS=list(PERCENTILES=8, BASELINE_PERCENTILES=8))
#####
### Run updateSGP analysis
#####
Utah_SGP <- updateSGP(
what_sgp_object = Utah_SGP,
with_sgp_data_LONG = Utah_Data_LONG_2021,
steps = c("prepareSGP", "analyzeSGP", "combineSGP"),
sgp.config = UT_Config_2021_PartA,
sgp.percentiles = TRUE,
sgp.projections = FALSE,
sgp.projections.lagged = FALSE,
sgp.percentiles.baseline = TRUE,
sgp.projections.baseline = FALSE,
sgp.projections.lagged.baseline = FALSE,
save.intermediate.results = FALSE,
parallel.config = parallel.config
)
### Copy SCALE_SCORE_PRIOR and SCALE_SCORE_PRIOR_STANDARDIZED to BASELINE counter parts
Utah_SGP@Data[YEAR=="2021", SCALE_SCORE_PRIOR_BASELINE := SCALE_SCORE_PRIOR]
Utah_SGP@Data[YEAR=="2021", SCALE_SCORE_PRIOR_STANDARDIZED_BASELINE := SCALE_SCORE_PRIOR_STANDARDIZED]
### Save results
save(Utah_SGP, file="Data/Utah_SGP.Rdata")