-
Notifications
You must be signed in to change notification settings - Fork 0
/
Utah_SGP_Baseline_2019_A_Matrix_Calculations.R
52 lines (41 loc) · 2.08 KB
/
Utah_SGP_Baseline_2019_A_Matrix_Calculations.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
#####################################################################################
### ###
### Utah Learning Loss Analyses -- Create Baseline Matrices ###
### ###
#####################################################################################
### NOTE: SCALE_SCORE is SCALE_SCORE_EQUATED in this file going forward. SCALE_SCORE_ORIGINAL is the original/actual scale score report on ISTEP+
### Load necessary packages
require(SGP) # v1.9-9.96 with updated SGPstateData
require(data.table)
### Load the results data created for 2019 BASELINE SGP analyses
load("Data/Utah_SGP_LONG_Data_PreCOVID.Rdata")
### Create a smaller subset of the LONG data to work with.
Utah_Baseline_Data <- data.table(Utah_SGP_LONG_Data_PreCOVID[, c("VALID_CASE", "CONTENT_AREA", "YEAR", "ID", "GRADE", "SCALE_SCORE", "ACHIEVEMENT_LEVEL"),])
### Read in Baseline SGP Configuration Scripts and Combine
source("SGP_CONFIG/2019/BASELINE/Matrices/ELA.R")
source("SGP_CONFIG/2019/BASELINE/Matrices/SCIENCE.R")
source("SGP_CONFIG/2019/BASELINE/Matrices/MATHEMATICS.R")
UT_BASELINE_CONFIG <- c(
ELA_BASELINE.config,
SCIENCE_BASELINE.config,
MATHEMATICS_BASELINE.config,
SEC_MATH_I_BASELINE.config
)
###
### Create Baseline Matrices
Utah_SGP <- prepareSGP(Utah_Baseline_Data, create.additional.variables=FALSE)
UT_Baseline_Matrices <- baselineSGP(
Utah_SGP,
sgp.baseline.config=UT_BASELINE_CONFIG,
return.matrices.only=TRUE,
calculate.baseline.sgps=FALSE,
goodness.of.fit.print=FALSE,
parallel.config = list(
BACKEND="PARALLEL", WORKERS=list(TAUS=15))
)
### Save results
save(UT_Baseline_Matrices, file="Data/UT_Baseline_Matrices.Rdata")
### Add Matrices to `SGPmatrices` package data object
load("../../Github_Repos/Packages/SGPmatrices/data/SGPmatrices.rda")
SGPmatrices[["UT_Baseline_Matrices"]][["2021"]] <- UT_Baseline_Matrices
save(SGPmatrices, file = "../../Github_Repos/Packages/SGPmatrices/data/SGPmatrices.rda")