A survey design object for non-probability samples and post-hoc calibrated
designs (e.g., raked online panels, post-stratified samples). Create with
as_survey_nonprob().
survey_nonprob(
data = data.frame(),
metadata = survey_metadata(),
variables = list(),
groups = character(0),
call = NULL,
calibration = NULL
)A survey_nonprob object.
A data.frame containing the survey data. Prefer
as_survey_nonprob() over calling this constructor directly.
A survey_metadata object. Created automatically by
as_survey_nonprob().
A named list of design specification (weights,
probs_provided). Set automatically by as_survey_nonprob().
Set by surveytidy's group_by(). Always character(0) in
standalone surveycore use.
Language object capturing the construction call.
The calibration provenance object returned by a
surveywts calibration function (e.g., surveywts::rake()),
or NULL if calibration was performed externally. Stores the
calibration targets, variables, and trimming parameters for
reproducibility and future bootstrap re-calibration. Default NULL.
This class is a skeleton added in Phase 0 to reserve its place in the
class hierarchy. The constructor as_survey_nonprob() accepts
pre-computed calibration weights and stores calibration provenance from
surveywts output.
Full functionality — including bootstrap variance with re-calibration on
each replicate — will be implemented in Phase 2.5 alongside the
surveywts package. Until then, estimation uses SRS-based variance
(same assumption as as_survey() with weights only).
Unlike as_survey(), as_survey_replicate(), and as_survey_twophase(),
this
class does not assume a probability sampling design. Standard errors
produced from a survey_nonprob object rest on a model-assisted SRS
assumption, which is consistent with common practice for calibrated
non-probability samples (e.g., raked online panels). See
vignette("creating-survey-objects") for guidance on when this is
appropriate and what the limitations are.
weightsCharacter string naming the (calibrated) weight column.
probs_providedAlways FALSE for calibrated designs.
When calibration is performed via surveywts, the returned calibration
object is stored here. It contains the calibration targets, variables used,
trimming cap, effective sample size before and after, and design effect.
NULL when calibration was performed externally (e.g., via anesrake).
as_survey_nonprob() to create a survey_nonprob object.
Other constructors:
as_survey(),
as_survey_nonprob(),
as_survey_replicate(),
as_survey_twophase(),
survey_data(),
survey_glm(),
survey_glm_fit(),
survey_replicate(),
survey_taylor(),
survey_twophase()