## Not run:
# ## 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.2013_2014 = list(
# sgp.content.areas=rep("MATHEMATICS", 3), # Note, must be same length as sgp.panel.years
# sgp.panel.years=c('2011_2012', '2012_2013', '2013_2014'),
# sgp.grade.sequences=list(3:4, 3:5, 4:6)),
# READING.2013_2014 = list(
# sgp.content.areas=rep("READING", 3),
# sgp.panel.years=c('2011_2012', '2012_2013', '2013_2014'),
# 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.2013_2014.READ_PRIOR = list(
# sgp.content.areas=c("READING", "MATHEMATICS"),
# sgp.panel.years=c('2012_2013', '2013_2014'),
# sgp.grade.sequences=list(3:4, 4:5, 5:6)),
# READING.2013_2014.MATH_PRIOR = list(
# sgp.content.areas=c("MATHEMATICS", "READING"),
# sgp.panel.years=c('2012_2013', '2013_2014'),
# 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.2012_2013 = list(
# sgp.content.areas=c("MATHEMATICS", "READING", "MATHEMATICS", "READING", "READING"),
# sgp.panel.years=c('2010_2011', '2010_2011', '2011_2012', '2011_2012', '2012_2013'),
# 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.2012_2013 = list(
# sgp.content.areas=c("READING", "MATHEMATICS", "READING", "MATHEMATICS", "MATHEMATICS"),
# sgp.panel.years=c('2010_2011', '2010_2011', '2011_2012', '2011_2012', '2012_2013'),
# 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 a snow socket cluster:
# # possibly a quad core machine with low RAM Memory
# # 4 workers for percentiles, 2 workers for projections.
# # Note the PSOCK type cluster is used for single machines.
#
# Demonstration_SGP <- prepareSGP(sgpData_LONG)
# Demonstration_SGP <- analyzeSGP(Demonstration_SGP,
# parallel.config=list(
# BACKEND="PARALLEL", TYPE="PSOCK",
# WORKERS=list(PERCENTILES=4,
# PROJECTIONS=2,
# LAGGED_PROJECTIONS=2,
# BASELINE_PERCENTILES=4))
#
# ## 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))
# ...
#
# ## FOREACH use cases:
# ...
# parallel.config=list(
# BACKEND="FOREACH", TYPE="doParallel",
# WORKERS=3)
# ...
#
#
# # 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
#
# ## End(Not run)
Run the code above in your browser using DataLab