## analyzeSGP is Step 2 of 5 of abcSGP
Demonstration_SGP <- sgpData_LONG
Demonstration_SGP <- prepareSGP(Demonstration_SGP)
Demonstration_SGP <- analyzeSGP(Demonstration_SGP)
## Or (explicitly pass state argument)
Demonstration_SGP <- prepareSGP(sgpData_LONG)
Demonstration_SGP <- analyzeSGP(Demonstration_SGP, state="DEMO")
###
### Example uses of the sgp.config argument
###
# Use only 3 years of Data, for grades 3 to 6
# and only perform analyses for most recent year (2012)
my.custom.config <- list(
MATHEMATICS.2011_2012 = list(
sgp.content.areas=rep("MATHEMATICS", 3), # Note, must be same length as sgp.panel.years
sgp.panel.years=c('2009_2010', '2010_2011', '2011_2012'),
sgp.grade.sequences=list(3:4, 3:5, 4:6)),
READING.2011_2012 = list(
sgp.content.areas=rep("READING", 3),
sgp.panel.years=c('2009_2010', '2010_2011', '2011_2012'),
sgp.grade.sequences=list(3:4, 3:5, 4:6)))
Demonstration_SGP <- prepareSGP(sgpData_LONG)
Demonstration_SGP <- analyzeSGP(Demonstration_SGP,
sgp.config=my.custom.config,
sgp.percentiles.baseline = FALSE,
sgp.projections.baseline = FALSE,
sgp.projections.lagged.baseline = FALSE,
simulate.sgps=FALSE)
## Another example sgp.config list:
# Use different CONTENT_AREA priors, and only 1 year of prior data
my.custom.config <- list(
MATHEMATICS.2011_2012.READ_PRIOR = list(
sgp.content.areas=c("READING", "MATHEMATICS"),
sgp.panel.years=c('2010_2011', '2011_2012'),
sgp.grade.sequences=list(3:4, 4:5, 5:6)),
READING.2011_2012.MATH_PRIOR = list(
sgp.content.areas=c("MATHEMATICS", "READING"),
sgp.panel.years=c('2010_2011', '2011_2012'),
sgp.grade.sequences=list(3:4, 4:5, 5:6)))
## An example showing multiple priors within a single year
Demonstration_SGP <- prepareSGP(sgpData_LONG)
DEMO.config <- list(
READING.2010_2011 = list(
sgp.content.areas=c("MATHEMATICS", "READING", "MATHEMATICS", "READING", "READING"),
sgp.panel.years=c('2008_2009', '2008_2009', '2009_2010', '2009_2010', '2010_2011'),
sgp.grade.sequences=list(c(3,3,4,4,5), c(4,4,5,5,6), c(5,5,6,6,7), c(6,6,7,7,8))),
MATHEMATICS.2010_2011 = list(
sgp.content.areas=c("READING", "MATHEMATICS", "READING", "MATHEMATICS", "MATHEMATICS"),
sgp.panel.years=c('2008_2009', '2008_2009', '2009_2010', '2009_2010', '2010_2011'),
sgp.grade.sequences=list(c(3,3,4,4,5), c(4,4,5,5,6), c(5,5,6,6,7), c(6,6,7,7,8))))
Demonstration_SGP <- analyzeSGP(Demonstration_SGP,
sgp.config=DEMO.config,
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)
###
### Example uses of the parallel.config argument
###
## Windows users must use snow:
# possibly a quad core machine with low RAM Memory
# 4 workers for percentiles, 2 workers for projections.
# Note the SOCK type cluster is used for single machines.
Demonstration_SGP <- prepareSGP(sgpData_LONG)
Demonstration_SGP <- analyzeSGP(Demonstration_SGP,
parallel.config=list(
BACKEND="SNOW", TYPE="SOCK",
WORKERS=list(PERCENTILES=4,
PROJECTIONS=2,
LAGGED_PROJECTIONS=2,
BASELINE_PERCENTILES=4))
## Windows users with R version >= 2.14.0 may prefer the parallel package:
# This example is would be good for a single workstation with 8 cores
# and enough RAM to use 8 workers for ALL analyses.
...
parallel.config=list(
BACKEND="PARALLEL", TYPE="SOCK"),
WORKERS=8)
...
# A similar specification for R versions pre 2.13 using SNOW:
...
parallel.config=list(
BACKEND="SNOW", TYPE="SOCK"),
WORKERS=8)
...
## Linux/Mac may use the multicore package directly:
...
parallel.config=list(
BACKEND="MULTICORE",
WORKERS=4)
...
## FOREACH use cases:
# doMC - only available on Linux or Mac OSX
...
parallel.config=list(
BACKEND="FOREACH", TYPE="doMC",
WORKERS=3)
...
# doMPI package - the number of workers is 100,
# suggesting this example is for a HPC cluster usage.
...
parallel.config=list(
BACKEND="FOREACH", TYPE="doMPI",
WORKERS=100)
...
## New parallel package - only available with R 2.13 or newer
# Note there are up to 16 workers, and MPI is used,
# suggesting this example is for a HPC cluster, possibly Windows OS.
...
parallel.config=list(
BACKEND="PARALLEL", TYPE="MPI",
WORKERS=list(PERCENTILES=16,
PROJECTIONS=8,
LAGGED_PROJECTIONS=6,
BASELINE_PERCENTILES=12))
...
# NOTE: This list of parallel.config specifications is NOT exhaustive.
# See examples in analyzeSGP documentation for some others.0
###
### Advanced Example: restrict years, recalculate baseline SGP
### coefficient matrices, and use parallel processing
###
# Remove existing DEMO baseline coefficient matrices from
# the SGPstateData object so that new ones will be computed.
SGPstateData$DEMO$Baseline_splineMatrix <- NULL
# set up a customized sgp.config list
. . .
# set up a customized sgp.baseline.config list
. . .
# to be completed
Run the code above in your browser using DataLab