Delta.clus | R Documentation |
Two small, partially overlapping datasets, built to mimick non-independent PSU samples selected with a one- or multi-stage, stratified, cluster sampling design (but identifiers of SSUs etc. are not reported). Allow to run R code contained in the ‘Examples’ section of ReGenesees function svyDelta
.
data(Delta.clus)
Two data frames, sclus1
and sclus2
, with 6 PSUs each (and 20 and 22 final units, respectively), and the following 5 variables.
For both samples sclus1
and sclus2
:
id
Identifier of sample PSUs, numeric
strata
Stratification variable, a factor
with 2
levels: A
, and B
w
Sampling weights of final units, numeric
y
A numeric
variable
x
A numeric
variable, correlated with y
The two samples, sclus1
and sclus2
, have 3 PSUs in common, resulting in an overlap rate of 3 / 6 = 0.5 at PSU-level. One could think of them as, e.g., two consecutive waves of a rotating panel with a 50% overlap at PSU-level.
Common PSUs are unambigously identified by variable id
.
The stratification is static: (1) sclus1
and sclus2
use the same strata (i.e. levels A
, and B
), and (2) no common PSUs changed stratum from sclus1
to sclus2
.
The ‘Examples’ section of svyDelta
will illustrate the effect of dynamic stratification by injecting new strata and stratum-changer units in the samples.
svyDelta
for calculating estimates and sampling errors of Measures of Change from two not necessarily independent samples, and Delta.el
for 2 artificial overlapping samples of elementary units.
data(Delta.clus)
# Have a look:
sclus1
sclus2
# Have a look at the overlap subsample of 3 PSUs (36 final units):
sc <- merge(sclus1, sclus2, by = "id", suffixes = c("1", "2"))
sc
# Have a look at the full rotation structure (50% PSUs overlap in each stratum):
s <- merge(sclus1, sclus2, by = "id", all = TRUE, suffixes = c("1", "2"))
s <- s[order(s$strata1, s$strata2), ]
s
# As anticipated, strata are static:
with(s, table(strata1, strata2, useNA = "ifany"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.