Skip to content

Instantly share code, notes, and snippets.

@dbetebenner
Last active December 12, 2015 09:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dbetebenner/4749279 to your computer and use it in GitHub Desktop.
Save dbetebenner/4749279 to your computer and use it in GitHub Desktop.
Code to demonstrate that one can apply SGP analyses to tests like NAPLAN that occur bi-annually.
######################################################################################
###
### Script to show use of SGP package with bi-annual assessment data like NAPLAN
###
######################################################################################
### Load SGP package
require(SGP)
### Need to modify meta-data in SGPstateData associated with state DEMO:
SGPstateData[["DEMO"]][["Growth"]][["System_Type"]] <- "Cohort Referenced"
SGPstateData[["DEMO"]][["Student_Report_Information"]][["Grades_Reported"]][["MATHEMATICS"]] <- c(4, 6, 8, 10)
SGPstateData[["DEMO"]][["Student_Report_Information"]][["Grades_Reported"]][["READING"]] <- c(4, 6, 8, 10)
SGPstateData[["DEMO"]][["Assessment_Program_Information"]][["Grades_Tested"]] <- c(4, 6, 8, 10)
SGPstateData[["DEMO"]][["Achievement"]][["Cutscores"]] <- list(
MATHEMATICS=list(
GRADE_4=c(383, 455, 538),
GRADE_6=c(454, 520, 589),
GRADE_8=c(521, 577, 628),
GRADE_10=c(562, 627, 692)),
READING=list(
GRADE_4=c(517, 572, 671),
GRADE_6=c(543, 600, 696),
GRADE_8=c(578, 632, 724),
GRADE_10=c(607, 663, 747)))
### Create bi-annual data set from sgpData_LONG data object.
sgpData_LONG_BIANNUAL <- sgpData_LONG[!sgpData_LONG$GRADE %in% c(3,5,7,9),]
### prepareSGP
Demonstration_SGP <- prepareSGP(sgpData_LONG_BIANNUAL, state="DEMO", create.additional.variables=FALSE)
### analyzeSGP
Demonstration_SGP <- analyzeSGP(Demonstration_SGP, state="DEMO",
sgp.percentiles=TRUE,
sgp.projections=TRUE,
sgp.projections.lagged=TRUE,
sgp.percentiles.baseline=FALSE,
sgp.projections.baseline=FALSE,
sgp.projections.lagged.baseline=FALSE,
simulate.sgps=FALSE)
### combineSGP
Demonstration_SGP <- combineSGP(Demonstration_SGP, state="DEMO")
### summarizeSGP
Demonstration_SGP <- summarizeSGP(Demonstration_SGP, state="DEMO")
### visualizeSGP
visualizeSGP(Demonstration_SGP,
state="DEMO",
plot.types=c("bubblePlot","growthAchievementPlot"), # sgPlots can be produced, but they are UGLY (especially in 6th grade)! Demo fails completely
bPlot.styles=c(1),
gaPlot.format="presentation",
gaPlot.years="2011_2012", #parallel.config=list(BACKEND="FOREACH", TYPE=NA, WORKERS=list(GA_PLOTS=1, SG_PLOTS=1, SG_PLOTS_TARGETS=1)))
sgPlot.demo.report=TRUE) # NOTE: Turning this off will produce all plots for all students in the DEMO data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment