Skip to contents

A survey design object for two-phase (double) sampling. Create with as_survey_twophase().

Usage

survey_twophase(
  data = data.frame(),
  metadata = survey_metadata(),
  variables = list(),
  groups = character(0),
  call = NULL
)

Arguments

data

A data.frame containing the survey data (all Phase 1 rows, with a logical indicator for Phase 2 membership). Prefer as_survey_twophase() over calling this constructor directly.

metadata

A survey_metadata object. Inherited from the Phase 1 design when using as_survey_twophase().

variables

A named list of design specification (phase1, phase2, subset, method). Set automatically by as_survey_twophase().

groups

Set by surveytidy's group_by(). Always character(0) in standalone surveycore use.

call

Language object capturing the construction call.

Value

A survey_twophase object.

Design variables (@variables)

phase1

Named list containing the Phase 1 design specification (from a survey_taylor object's @variables).

phase2

Named list with optional Phase 2 design columns: ids, strata, probs, fpc — each NULL or a character vector of column names.

subset

Character string naming the logical column that indicates Phase 2 membership (TRUE = selected into Phase 2).

method

"full", "approx", or "simple".