View source: R/multiphase_inference.R
multiphase | R Documentation |
These objects represent designs with arbitrarily many nested phases of sampling, allowing estimation and (in the future) calibration/raking at each phase
multiphase(ids, subset, strata, probs, data, fpc = NULL,
check.variable.phase=TRUE)
ids |
List of as many model formulas as phases describing ids for each phase. Each formula may indicate multistage sampling |
subset |
list of model formulas for each phase except the first, specifying a logical vector of which observations from the previous phase are included |
strata |
List of as many model formulas as phases describing strata for each phase. Each formula may
indicate multistage sampling, or |
probs |
List of as many model formulas or |
data |
data frame of data |
fpc |
Finite population correction for the first phase, if needed |
check.variable.phase |
Work out which phase each variable is
observed in by looking at missing value patterns. You may want
|
Variance calculation uses a decomposition with sampling contributions
at each stage, which are returned as the phases
attribution of
a variance-covariance matrix. The computations broadly follow the
description for two-phase sampling in chapter 9 of Sarndal et al
(1991); there is more detail in the vignette
Object of class multiphase
There are currently methods for svytotal
,
svymean
, svyglm
, svyvar
. Calibration is not yet implemented, nor is NA
handling.
Sarndal, Swensson, and Wretman (1991) "Model Assisted Survey Sampling" (Chapter 9)
twophase
for older implementations of two-phase sampling
vignette("multiphase")
for computational details
data(nwtco)
dcchs<-twophase(id = list(~seqno, ~seqno), strata = list(NULL, ~rel),
subset = ~I(in.subcohort | rel), data = nwtco)
mcchs<-multiphase(id = list(~seqno, ~seqno), strata = list(NULL, ~rel),
subset = list(~I(in.subcohort | rel)), probs = list(~1, NULL),
data = nwtco)
dcchs
mcchs
svymean(~edrel, dcchs)
svymean(~edrel, mcchs)
summary(svyglm(edrel~rel+histol+stage, design=dcchs))
summary(svyglm(edrel~rel+histol+stage, design=mcchs))
m<-calibrate(mcchs,~factor(stage)+rel, phase=2, calfun="raking")
vcov(svytotal(~factor(stage), m))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.