View source: R/swing-schedule.R
| swing_schedule | R Documentation |
Assembles a per-year project_enrollment() schedule for a school passing
through a temporary relocation ("swing"): enrollment is held flat at the
depressed observed level during the swing (identity steps), scaled by
year-over-year recovery multipliers for the recovery window (diagonal steps),
then projected with the grade progression ratio method (the normal
projection matrix) for the remaining years.
swing_schedule(
ratios,
horizon,
swing_years,
recovery,
entry = NULL,
grade_order = NULL
)
ratios |
A data frame or data-frame subclass with columns |
horizon |
Number of years to project (a positive integer). |
swing_years |
Number of leading years the school is swinging (a
non-negative integer); enrollment is held flat at |
recovery |
Recovery multipliers applied for one year each, immediately
after the swing and compounding on the prior year: a numeric vector
(whole-school, one multiplier per recovery year) or a grade-by-year numeric
matrix (one row per grade). Values must be finite, non-missing, and
non-negative. Named matrix rows are matched and reordered by grade;
unnamed rows are interpreted in projection grade order. Use |
entry |
Exogenous entry-grade enrollment for the normal grade
progression ratio years only: one finite, non-missing, non-negative
numeric value for each of the
|
grade_order |
Optional character vector giving the low-to-high grade
order. If omitted, the order is reconstructed from the transition chain.
Every non-entry grade in |
A list of horizon projection steps suitable for the schedule
argument of project_enrollment().
ratios <- data.frame(
grade_from = c("K", "1"), grade_to = c("1", "2"), ratio = c(0.92, 0.97)
)
schedule <- swing_schedule(ratios,
horizon = 6, swing_years = 2,
recovery = c(1.10, 1.10, 1.05), entry = 130
)
project_enrollment(c(K = 80, `1` = 66, `2` = 60), schedule = schedule)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.