Delta.el | R Documentation |
Two small, partially overlapping datasets, built to mimick non-independent samples selected with a one-stage, stratified, element sampling design. Allow to run R code contained in the ‘Examples’ section of ReGenesees function svyDelta
.
data(Delta.el)
Two data frames, s1
and s2
, with 20 observations each and the following 5 variables.
For both samples s1
and s2
:
id
Identifier of sample units, numeric
strata
Stratification variable, a factor
with 2
levels: A
, and B
w
Sampling weights, numeric
y
A numeric
variable
x
A numeric
variable, correlated with y
The two samples, s1
and s2
, have 8 units in common, resulting in an overlap rate of 8 / 20 = 0.4. One could think of them as, e.g., two consecutive waves of a rotating panel with a 40% overlap.
Common units are unambigously identified by variable id
.
The stratification is static: (1) s1
and s2
use the same strata (i.e. levels A
, and B
), and (2) no common units changed stratum from s1
to s2
.
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.clus
for 2 artificial overlapping samples of clusters.
data(Delta.el)
# Have a look:
s1
s2
# Have a look at the overlap subsample of 8 units:
sc <- merge(s1, s2, by = "id", suffixes = c("1", "2"))
sc
# Have a look at the full rotation structure (40% overlap in each stratum):
s <- merge(s1, s2, 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.