Skip to content

Instantly share code, notes, and snippets.

@bhoung
Last active December 13, 2015 21:09
Show Gist options
  • Save bhoung/4975499 to your computer and use it in GitHub Desktop.
Save bhoung/4975499 to your computer and use it in GitHub Desktop.
generate growth and achievement plot
SGPstateData[["NAPLAN"]][["Growth"]][["System_Type"]] <- "Cohort Referenced"
SGPstateData[["NAPLAN"]][["Student_Report_Information"]][["Grades_Reported"]][["NUMERACY"]] <- c(3, 5, 7)
SGPstateData[["NAPLAN"]][["Assessment_Program_Information"]][["Grades_Tested"]] <- c(3, 5, 7)
SGPstateData$NAPLAN$Growth$Levels <- c("Very Low", "Low", "Typical", "High", "Very High")
SGPstateData[["NAPLAN"]][["Growth"]][["Cutscores"]] <-
list(Cuts=c(20, 40, 60, 80),
Labels=list("1st - 19th", "20th - 39th", "40th - 59th", "60th-79th", "80th-99th"))
#NUM YR3 2008
s1 <- read.dta("C:/Protected/MI/Naplan/sgp/long/YR3_2008.dta")
s1 <- s1[s1$CONTENT_AREA == "NUMERACY" | s1$CONTENT_AREA=="READING",]
# this line attempts to avoid analyzeSGP error message later on...
s1$GRADE <- as.numeric(s1$GRADE)
# drop ind_sample column
s1 <- s1[c(-5)]
prepared <- prepareSGP(s1, state="NAPLAN", create.additional.variables=FALSE)
custom.config <- list(
NUM.2010_2011 = list(
sgp.content.areas=c("READING","NUMERACY","NUMERACY"),
sgp.panel.years=c('2008','2008','2010'),
sgp.grade.sequences=list(c(3,3,5)))
)
SGP <- analyzeSGP(prepared, state="NAPLAN",
sgp.config=custom.config,
sgp.percentiles=TRUE,
simulate.sgps=FALSE,
sgp.projections=FALSE,
sgp.projections.lagged=FALSE,
sgp.percentiles.baseline=FALSE,
sgp.projections.baseline=FALSE,
sgp.projections.lagged.baseline=FALSE,
sgp.config.drop.nonsequential.grade.progression.variables=FALSE)
### combineSGP
SGP <- combineSGP(SGP, state="NAPLAN")
### summarizeSGP
SGP <- summarizeSGP(SGP, state="NAPLAN")
### visualizeSGP
visualizeSGP(SGP,
state="NAPLAN",
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
#Started visualizeSGP Mon Feb 18 17:35:29 2013
#
#Started bubblePlot in visualizeSGP Mon Feb 18 17:35:29 2013
#
#Started bubblePlot Style 1 Mon Feb 18 17:35:29 2013
#Error in names.merge(tmp.bPlot.data, bPlot.anonymize) :
#object 'tmp.names' not found
SGP2 <- analyzeSGP(prepared, state="NAPLAN",
sgp.config=custom.config,
sgp.percentiles=TRUE,
simulate.sgps=FALSE,
sgp.projections=TRUE,
sgp.projections.lagged=TRUE,
sgp.percentiles.baseline=FALSE,
sgp.projections.baseline=FALSE,
sgp.projections.lagged.baseline=FALSE,
sgp.config.drop.nonsequential.grade.progression.variables=FALSE)
#Started analyzeSGP Mon Feb 18 17:36:59 2013
#Started studentGrowthPercentiles: Mon Feb 18 17:37:00 2013
#
#Content Area: NUMERACY, Year: 2010, Grade Progression: 3, 3, 5 (N=30,657)
#Finished SGP Student Growth Percentile Analysis: Mon Feb 18 17:38:16 2013 in 00:01:16
#
#Error in studentGrowthProjections(panel.data = panel.data, sgp.labels = list(my.year = tail(sgp.iter[["sgp.panel.years"]], :
#The current implementation of studentGrowthProjections does not allcw for non-numeric grades. Stay tuned for a better implementation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment