A svyplan_rotation from design_rotation() is a numeric vector of takes,
one entry per period of a unit's life. as.double() gives that vector
bare. as.data.frame() lays the pattern out over time as the table of
cells plot.svyplan_rotation() draws, one row per interview of every
panel in the periods drawn.
Usage
# S3 method for class 'svyplan_rotation'
print(x, ...)
# S3 method for class 'svyplan_rotation'
format(x, ...)
# S3 method for class 'svyplan_rotation'
as.double(x, ...)
# S3 method for class 'svyplan_rotation'
as.data.frame(
x,
row.names = NULL,
optional = FALSE,
stringsAsFactors = FALSE,
validRN = TRUE,
start = c("gradual", "immediate"),
horizon = NULL,
panel_plan = NULL,
...
)
# S3 method for class 'svyplan_rotation'
x$name
# S3 method for class 'svyplan_rotation'
Ops(e1, e2)
# S3 method for class 'svyplan_rotation'
Math(x, ...)
# S3 method for class 'svyplan_rotation'
x[i] <- value
# S3 method for class 'svyplan_rotation'
x[[i]] <- value
# S3 method for class 'svyplan_rotation'
x$name <- valueArguments
- x
A
svyplan_rotationobject.- ...
Additional arguments are not supported and produce an error.
- row.names, optional, stringsAsFactors, validRN
Standard
as.data.frame()arguments.- start, horizon, panel_plan
How the first panels enter, the periods covered and an optional
n_panel()result, as forplot.svyplan_rotation().- name
Field to extract:
spec,life,in_sample,unbrokenorequal_take.- e1, e2
Operands. Arithmetic and comparison return bare numerics, since moved takes no longer have the life, standing sample and spec the rotation records.
- i, value
Index and replacement value. Replacement is refused: build the pattern you mean with
design_rotation().
Value
The method-specific result:
print()Returns
xinvisibly.format()Returns a string.
as.double()Returns the take vector.
$Returns one field of the pattern.
Ops()andMath()Return bare numerics.
as.data.frame()Returns one row per interview, ordered by panel and then period, with columns:
periodThe period of the interview.
panelThe panel, numbered in the chart's order: under an immediate start the start-up panels first, the one with the shortest remaining life first, then one new panel per period. Each panel here is one cohort, the units at the same wave at every period, so the chart needs no separate cohort column.
entryThe period the panel is selected. A start-up panel whose remaining life starts out of sample is selected in period 1 and first interviewed later.
startupTRUEfor a panel of an immediate start.rotation_groupThe rotation group the panel takes over, as defined on
plot.svyplan_rotation().waveThe place of the interview in the rotation pattern, counting in-sample periods only.
visitThe interview number of the panel. Equal to
waveexcept for a start-up panel.life_stageThe period of the full life, out-of-sample periods counted.
takeThe take at that period, 1 under an equal take.
nUnits interviewed,
taketimes the panel's entrants. Present only whenpanel_planis given.
The attributes
rotation,start,horizonandfull_sample_from, the first period with the full sample in the field, describe the table.
See also
design_rotation(), which builds these objects,
plot.svyplan_rotation() for the chart of the cell table, and
design_overlap() for the lag profile one produces.
Examples
cps <- design_rotation("4-8-4")
cps
#> Rotation pattern (planning)
#>
#> life: 16 periods, 8 in sample each period
#> rotation: 4 in, 8 out, 4 in
as.double(cps)
#> [1] 1 1 1 1 0 0 0 0 0 0 0 0 1 1 1 1
# The fields of the pattern
cps$life
#> [1] 16
cps$in_sample
#> [1] 8
cps$unbroken
#> [1] FALSE
# Arithmetic returns plain takes, never a rotation with stale fields
2 * cps
#> [1] 2 2 2 2 0 0 0 0 0 0 0 0 2 2 2 2
# The cells of an immediate start: a start-up panel's first interview can
# be at a later wave
cells <- as.data.frame(design_rotation("2-2-2"), start = "immediate",
horizon = 8)
head(cells, 8)
#> period panel entry startup rotation_group wave visit life_stage take
#> 1 1 1 1 TRUE 1 4 1 6 1
#> 2 1 2 1 TRUE 2 3 1 5 1
#> 3 2 2 1 TRUE 2 4 2 6 1
#> 4 2 3 1 TRUE 1 3 1 5 1
#> 5 3 3 1 TRUE 1 4 2 6 1
#> 6 3 4 1 TRUE 2 3 1 5 1
#> 7 4 4 1 TRUE 2 4 2 6 1
#> 8 1 5 1 TRUE 3 2 1 2 1
# Which panels are at their first wave in period 6
subset(cells, period == 6 & wave == 1)
#> period panel entry startup rotation_group wave visit life_stage take
#> 28 6 11 6 FALSE 1 1 1 1 1