Print, summarize and coerce a longitudinal design schedule
Source:R/design_schedule.R
print.svyplan_schedule.Rdprint() states the issue profile as a run of takes rather than as one
row per period, because a schedule's periods are mostly identical and
its length is set by the reporting horizon rather than by the design.
summary() gives the period-by-period tables: the issue profile in
full, the selections, the overlap the rotation produces, and the
interviews owed after the horizon. as.data.frame() returns the issue
profile, and every table stays reachable as a field.
Usage
# S3 method for class 'svyplan_schedule'
print(x, ...)
# S3 method for class 'svyplan_schedule'
summary(object, ...)
# S3 method for class 'summary.svyplan_schedule'
print(x, ...)
# S3 method for class 'svyplan_schedule'
format(x, ...)
# S3 method for class 'svyplan_schedule'
as.data.frame(
x,
row.names = NULL,
optional = FALSE,
stringsAsFactors = FALSE,
validRN = TRUE,
...
)
# S3 method for class 'svyplan_schedule'
x$name <- value
# S3 method for class 'svyplan_schedule'
x[i] <- value
# S3 method for class 'svyplan_schedule'
x[[i]] <- valueArguments
- x
An
svyplan_schedule, or thesummary.svyplan_scheduleobjectsummary()returns.- ...
Additional arguments are not supported and produce an error.
- object
An
svyplan_schedule.- row.names, optional, stringsAsFactors, validRN
Standard
as.data.frame()arguments.- name, i, value
Standard replacement arguments for
$<-,[[<-, and[<-. These operations are refused because they would break reconciliation within the schedule object.
Value
print() returns its argument invisibly, summary() an object of
class summary.svyplan_schedule carrying the schedule and its four
tables, format() one descriptive string, and as.data.frame() the
issue profile.
Direct field and table replacement with $<-, [[<-, or [<- is refused
because the metadata and tables describe one reconciled design. Recompute
with design_schedule() to change the plan, or extract a table first to
modify a plain data frame.
See also
design_schedule(), which builds these objects, n_panel() for
the rotating plan they schedule, and print.svyplan_overlap() for the
rotation the life describes.
Examples
panel <- n_panel(
n_prop(p = 0.5, moe = 0.03),
retention = c(0.9, 0.9, 0.9),
resp_rate = 0.75,
design = "rotating",
start = "immediate"
)
schedule <- design_schedule(
panel,
horizon = 6,
horizon_policy = "continuing",
refreshment = "entrant_register",
rounding = "ceiling"
)
schedule
#> Longitudinal design schedule (immediate start, continuing)
#> life: 4 periods, 4 in sample each period
#> horizon: 6 periods, equilibrium from period 4
#> rounding: ceiling at panel level
#> issue: 1656 at start-up, 414 per period (periods 2-6)
#> tail commitments: 6 panel-interviews after period 6
#> # summary() for the period-by-period profile and the overlap
# the period-by-period tables the print block summarizes
s <- summary(schedule)
s
#> Analysis of a longitudinal design schedule (immediate start, continuing)
#>
#> life: 4 periods, 4 in sample each period
#> horizon: 6 periods, equilibrium from period 4
#> rounding: ceiling at panel level, 414 entrants per period against the plan's 413.7 (+0.1%)
#> entrants: 414 per period, 1656 in sample across 4 cohorts
#> refreshment: entrant_register
#>
#> Issue profile
#> period subround selection planned_issue operational_issue cohort_issue
#> 1 1 startup 1654.856 1656 1656
#> 2 1 period_2 413.714 414 414
#> 3 1 period_3 413.714 414 414
#> 4 1 period_4 413.714 414 414
#> 5 1 period_5 413.714 414 414
#> 6 1 period_6 413.714 414 414
#> equilibrium
#> FALSE
#> FALSE
#> FALSE
#> TRUE
#> TRUE
#> TRUE
#>
#> Selections
#> selection entry_period frame_role planned_issue operational_issue panels
#> startup 1 startup 1654.856 1656 4
#> period_2 2 entrant_register 413.714 414 1
#> period_3 3 entrant_register 413.714 414 1
#> period_4 4 entrant_register 413.714 414 1
#> period_5 5 entrant_register 413.714 414 1
#> period_6 6 entrant_register 413.714 414 1
#> panel_issue
#> 414
#> 414
#> 414
#> 414
#> 414
#> 414
#>
#> Overlap the rotation produces
#> lag shared in_sample overlap
#> 1 3 4 0.75
#> 2 2 4 0.50
#> 3 1 4 0.25
#> tail commitments: 6 panel-interviews after period 6
#> # $activity for the panel-level schedule, $tail_commitments for the tail
# every table stays reachable as a field
schedule$selections
#> selection entry_period frame_role planned_issue operational_issue
#> 1 startup 1 startup 1654.856 1656
#> 2 period_2 2 entrant_register 413.714 414
#> 3 period_3 3 entrant_register 413.714 414
#> 4 period_4 4 entrant_register 413.714 414
#> 5 period_5 5 entrant_register 413.714 414
#> 6 period_6 6 entrant_register 413.714 414
#> panels panel_issue frame_vintage status
#> 1 4 414 <NA> planned
#> 2 1 414 <NA> planned
#> 3 1 414 <NA> planned
#> 4 1 414 <NA> planned
#> 5 1 414 <NA> planned
#> 6 1 414 <NA> planned
schedule$tail_commitments
#> period subround selection cohort panel rotation_group wave visit life_stage
#> 1 7 1 period_4 7 7 3 4 4 4
#> 2 7 1 period_5 8 8 4 3 3 3
#> 3 7 1 period_6 9 9 1 2 2 2
#> 4 8 1 period_5 8 8 4 4 4 4
#> 5 8 1 period_6 9 9 1 3 3 3
#> 6 9 1 period_6 9 9 1 4 4 4
#> life_length relative_take
#> 1 4 1
#> 2 4 1
#> 3 4 1
#> 4 4 1
#> 5 4 1
#> 6 4 1
# as.data.frame() returns the issue profile
as.data.frame(schedule)
#> period subround selection planned_issue operational_issue cohort_issue
#> 1 1 1 startup 1654.856 1656 1656
#> 2 2 1 period_2 413.714 414 414
#> 3 3 1 period_3 413.714 414 414
#> 4 4 1 period_4 413.714 414 414
#> 5 5 1 period_5 413.714 414 414
#> 6 6 1 period_6 413.714 414 414
#> equilibrium
#> 1 FALSE
#> 2 FALSE
#> 3 FALSE
#> 4 TRUE
#> 5 TRUE
#> 6 TRUE