-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathColorado_SGP_2026.R
More file actions
130 lines (115 loc) · 4.96 KB
/
Copy pathColorado_SGP_2026.R
File metadata and controls
130 lines (115 loc) · 4.96 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
#+ include = FALSE, purl = FALSE, eval = FALSE
###########################################################################u###
### ###
### Colorado 2026 CMAS and PSAT-SAT SGP analyses ###
### ###
##############################################################################
### Load packages
require(SGP)
require(data.table)
### Load 2025 growth data and results
load("Data/Colorado_SGP.Rdata")
## Clean up ACHIEVEMENT_LEVEL from 2025
Colorado_SGP@Data[
ACHIEVEMENT_LEVEL %in% c("NA", "0011", "0012", "0013", "0014", "UUUU"),
ACHIEVEMENT_LEVEL := "No Score"
]
table(Colorado_SGP@Data[, .(YEAR, GRADE), ACHIEVEMENT_LEVEL])
### Load current year, formatted data
load("Data/Colorado_CMAS_Data_2026.Rdata")
load("Data/Colorado_PSAT_Data_2026.Rdata")
### Read in SGP configuration scripts and combine
source("SGP_CONFIG/2026/ELA.R")
source("SGP_CONFIG/2026/MATHEMATICS.R")
source("SGP_CONFIG/2026/CO_Proj_Sequences.R")
CO_Config_2026 <- c(
ELA_2026.config,
# ELA_PSAT_9_2026.config,
ELA_PSAT_10_2026.config,
ELA_SAT_2026.config,
MATHEMATICS_2026.config,
MATHEMATICS_PSAT_9_2026.config,
MATHEMATICS_PSAT_10_2026.config,
MATHEMATICS_SAT_2026.config
)
### Parallel Config
parallel.config <- list(
WORKERS = list(
PERCENTILES = 10,
PROJECTIONS = 8,
LAGGED_PROJECTIONS = 8,
SGP_SCALE_SCORE_TARGETS = 8
))
### Run updateSGP analysis
Colorado_SGP <-
updateSGP(
what_sgp_object = Colorado_SGP,
with_sgp_data_LONG = rbindlist(list(
Colorado_CMAS_Data_2026,
Colorado_PSAT_Data_2026),
use.names = TRUE, fill = TRUE
),
steps = c("prepareSGP", "analyzeSGP", "combineSGP", "outputSGP"),
sgp.config = CO_Config_2026,
sgp.percentiles = TRUE,
sgp.projections = TRUE,
sgp.projections.lagged = TRUE,
sgp.percentiles.baseline = FALSE,
sgp.projections.baseline = FALSE,
sgp.projections.lagged.baseline = FALSE,
sgp.target.scale.scores = TRUE,
outputSGP.output.type = c("LONG_Data", "LONG_FINAL_YEAR_Data"),
save.intermediate.results = FALSE,
parallel.config = parallel.config
)
### Add R session Info & Save results (`cfaDocs` version 0.0-1.12 or later)
source(
system.file(
"rmarkdown", "shared_resources", "rmd", "R_Session_Info.R",
package = "cfaDocs"
)
)
## Need to fix `prepareSGP` to allow for these features
Colorado_SGP@Version[["session_platform"]][["2026"]] <- session_platform
Colorado_SGP@Version[["attached_pkgs"]][["2026"]] <- attached_pkgs
Colorado_SGP@Version[["namespace_pkgs"]][["2026"]] <- namespace_pkgs
### Save results with all CMAS and PSAT/SAT results
save(Colorado_SGP, file = "Data/Colorado_SGP.Rdata")
#' ### Conduct SGP analyses
#'
#' Cohort-referenced SGPs were calculated concurrently using
#' the [`R` Software Environment](http://www.r-project.org)
#' in conjunction with the [`SGP` package](http://sgp.io).
#' Broadly, the Colorado CMAS analyses were completed in five steps.
#'
#' 1. `prepareSGP`
#' 2. `analyzeSGP`
#' 3. `combineSGP`
#' 4. `outputSGP`
#' 5. `visualizeSGP`
#'
#' Because these steps are almost always conducted simultaneously, the `SGP`
#' package has "wrapper" functions, `abcSGP` and `updateSGP`, that combine
#' the above steps into a single function call and simplify the source code
#' associated with the data analysis. Documentation for all SGP functions are
#' [available online.](https://cran.r-project.org/web/packages/SGP/SGP.pdf)
#'
#' We use the [`updateSGP`](https://www.rdocumentation.org/packages/SGP/versions/2.2-0.0/topics/updateSGP)
#' function to ***a)*** do the final preparation and addition of the cleaned and
#' formatted new annual data,
#' ([`prepareSGP`](https://www.rdocumentation.org/packages/SGP/versions/2.2-0.0/topics/prepareSGP)
#' step), ***b)*** calculate SGP estimates
#' ([`analyzeSGP`](https://www.rdocumentation.org/packages/SGP/versions/2.2-0.0/topics/analyzeSGP)
#' step), ***c)*** merge the results into the master longitudinal data set
#' ([`combineSGP`](https://www.rdocumentation.org/packages/SGP/versions/2.2-0.0/topics/combineSGP)
#' step) and ***d)*** output a pipe delimited version of the complete long data
#' ([`outputSGP`](https://www.rdocumentation.org/packages/SGP/versions/2.2-0.0/topics/outputSGP)
#' step).
#'
#' #### Visualize results
#'
#' Once all analyses were completed via `updateSGP`, individual student growth
#' reports were produced using the [`visualizeSGP`](https://www.rdocumentation.org/packages/SGP/versions/2.2-0.0/topics/visualizeSGP)
#' function and a custom template designed for Colorado. English and Spanish
#' language versions of these reports were created, and the individual reports
#' and school level catalogs were bundled according to CDE specifications.