Skip to content

Instantly share code, notes, and snippets.

@dbetebenner
Created April 14, 2021 13:34
Show Gist options
  • Save dbetebenner/e3b710a77e5eb6bd32881d4b257bc801 to your computer and use it in GitHub Desktop.
Save dbetebenner/e3b710a77e5eb6bd32881d4b257bc801 to your computer and use it in GitHub Desktop.
Script that tests and shows how the bootstrapSRS function in the cfaTools package gets used to produced inferred aggregate values.
#################################################################
###
### Test of boostrapSRS function with aggregated learning loss data
###
#################################################################
### Load packages
require(SGP)
require(cfaTools) ## Use 0.0-0.6 or greater off of GitHub: remotes::install_github("centerforassessment/cfaTools")
require(data.table)
#debug(bootstrapSRS)
### Load data (use 2021 learning loss object created )
load("Data/Demonstration_COVID_SGP_2021_STEP_3c.Rdata")
### Define parameters
national.ethnicity.proportions <- c(.157, .054, .261, .033, .495)
names(national.ethnicity.proportions) <- c("African American", "Asian", "Hispanic", "Other", "White")
### Try to add in bootstrapSRS modified value
tmp.summaries <- Demonstration_COVID_SGP@Data[VALID_CASE=="VALID_CASE" & YEAR=="2021",
list(MEAN_SCALE_SCORE=mean(SCALE_SCORE, na.rm=TRUE),
MEAN_SGP=mean(SGP, na.rm=TRUE),
MEAN_SCALE_SCORE_INFERRED=bootstrapSRS(SCALE_SCORE, ETHNICITY, national.ethnicity.proportions)[[1]],
MEAN_SGP_INFERRED=bootstrapSRS(SGP, ETHNICITY, national.ethnicity.proportions)[[1]]), keyby=c("YEAR", "CONTENT_AREA", "GRADE")]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment