-
Notifications
You must be signed in to change notification settings - Fork 0
/
WIDA_IN_SGP_Baseline_2020_B_Growth_Percentiles.R
53 lines (43 loc) · 2.29 KB
/
WIDA_IN_SGP_Baseline_2020_B_Growth_Percentiles.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
####################################################################################
### ###
### WIDA Indiana Learning Loss Analyses -- 2020 Baseline Growth Percentiles ###
### ###
####################################################################################
### Load packages
require(SGP)
### Load data and remove years that will not be used.
load("Data/WIDA_IN_SGP_LONG_Data.Rdata")
### Test for BASELINE related variable in LONG data and NULL out if they exist
if (length(tmp.names <- grep("BASELINE|SS", names(WIDA_IN_SGP_LONG_Data))) > 0) {
WIDA_IN_SGP_LONG_Data[,eval(tmp.names):=NULL]
}
### Add single-cohort baseline matrices to SGPstateData
SGPstateData <- SGPmatrices::addBaselineMatrices("WIDA_IN", "2021")
#####
### Run BASELINE SGP analysis - create new WIDA_IN_SGP object with historical data
#####
### Temporarily set names of prior scores from sequential/cohort analyses
data.table::setnames(WIDA_IN_SGP_LONG_Data,
c("SCALE_SCORE_PRIOR", "SCALE_SCORE_PRIOR_STANDARDIZED"),
c("SS_PRIOR_COHORT", "SS_PRIOR_STD_COHORT"))
SGPstateData[["WIDA_IN"]][["Assessment_Program_Information"]][["CSEM"]] <- NULL
WIDA_IN_SGP <- abcSGP(
sgp_object = WIDA_IN_SGP_LONG_Data,
steps = c("prepareSGP", "analyzeSGP", "combineSGP", "outputSGP"),
sgp.percentiles = FALSE,
sgp.projections = FALSE,
sgp.projections.lagged = FALSE,
sgp.percentiles.baseline = TRUE, # Skip year SGPs for 2021 comparisons
sgp.projections.baseline = FALSE, # Calculated in next step
sgp.projections.lagged.baseline = FALSE,
save.intermediate.results = FALSE,
parallel.config = list(
BACKEND = "PARALLEL",
WORKERS=list(BASELINE_PERCENTILES=8))
)
### Re-set and rename prior scores (one set for sequential/cohort, another for skip-year/baseline)
data.table::setnames(WIDA_IN_SGP@Data,
c("SCALE_SCORE_PRIOR", "SCALE_SCORE_PRIOR_STANDARDIZED", "SS_PRIOR_COHORT", "SS_PRIOR_STD_COHORT"),
c("SCALE_SCORE_PRIOR_BASELINE", "SCALE_SCORE_PRIOR_STANDARDIZED_BASELINE", "SCALE_SCORE_PRIOR", "SCALE_SCORE_PRIOR_STANDARDIZED"))
### Save results
save(WIDA_IN_SGP, file="Data/WIDA_IN_SGP.Rdata")