Skip to content

Instantly share code, notes, and snippets.

@dbetebenner
Last active August 29, 2015 14:06
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/df373168b7c32c868429 to your computer and use it in GitHub Desktop.
Save dbetebenner/df373168b7c32c868429 to your computer and use it in GitHub Desktop.
Basic Projections using just two grades (3 and 4) of data
#########################################################################
###
### Basic percentiles and projections for two grades of data
###
#########################################################################
### Load packages
require(SGP)
require(SGPdata)
### Create data set
my.data <- subset(sgpData, GRADE_2014==4 | GRADE_2013==3, select=c("ID", "GRADE_2014", "GRADE_2015", "SS_2014", "SS_2015"))
### First calculate SGPs for 2015
my.grade.sequences <- list(3:4)
my.sgpData <- list(Panel_Data = my.data)
for (i in seq_along(my.grade.sequences)) {
my.sgpData <- studentGrowthPercentiles(panel.data=my.sgpData,
sgp.labels=list(my.year=2015, my.subject="Reading"),
grade.progression=my.grade.sequences[[i]])
}
###
### Get the 3 grade students from 2014
###
my.data.for.projections <- subset(my.data, GRADE_2014==3, select=c("ID", "GRADE_2014", "SS_2014"))
my.sgpData$Panel_Data <- my.data.for.projections
## Calculate Growth Projections
my.grade.progressions <- list(3)
for (i in seq_along(my.grade.progressions)) {
my.sgpData <- studentGrowthProjections(panel.data=my.sgpData,
sgp.labels=list(my.year=2014, my.subject="Reading"),
percentile.trajectory.values=c(25, 50, 75),
grade.progression=my.grade.progressions[[i]])
}
### Save the Student Growth Projections Results to a .csv file:
write.csv(my.sgpData$SGProjections$READING.2015, file= "2015_Reading_SGProjections.csv", row.names=FALSE, quote=FALSE)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment