gen_informative_sample {growfunctions} | R Documentation |
Generate a finite population and take an informative single or two-stage sample.
Description
Used to compare performance of sample design-weighted and unweighted estimation procedures.
Usage
gen_informative_sample(
clustering = TRUE,
two_stage = FALSE,
theta = c(0.2, 0.7, 1),
M = 3,
theta_star = matrix(c(0.3, 0.3, 0.3, 0.31, 0.72, 2.04, 0.58, 0.83, 1), 3, 3, byrow =
TRUE),
gp_type = "rq",
N = 10000,
T = 15,
L = 10,
R = 8,
I = 4,
n = 750,
noise_to_signal = 0.05,
incl_gradient = "medium"
)
Arguments
clustering |
Boolean input on whether want population generated from clusters of covariance
parameters. Defaults to |
two_stage |
Boolean input on whether want two stage sampling, with first stage defining set
of |
theta |
A numeric vector of global covariance parameters in the case of |
M |
Scalar input denoting number of clusters to employ if |
theta_star |
An P x M matrix of cluster location values associated with the choice of
|
gp_type |
Input of choice for covariance matrix formulation to be used to generate the functions
for the |
N |
A scalar input denoting the number of population units (or establishments). |
T |
A scalar input denoting the number of time points in each of |
L |
A scalar input that denotes the number of blocks in which to assign the population
units to be sub-sampled in the first stage of sampling.
Defaults to |
R |
A scalar input that denotes the number of blocks to sample from |
I |
A scalar input denoting the number of strata to form within each block. Population units
are divided into equally-sized strata based on variance quantiles. Defaults to |
n |
Sample size to be generated. Both an informative sample under either single
( |
noise_to_signal |
A numeric input in the interval, |
incl_gradient |
A character input on whether stratum probabilities from lowest-to-highest
is to |
Value
A list object named dat_sim
containing objects related to the generated sample
finite population, the informative sample and the non-informative, iid, sample.
Some important objects, include:
H |
A vector of length |
map.tot |
A |
map.obs |
A |
map.iid |
A |
(y , bb) |
N x T |
(y_obs , bb_obs) |
N x T |
(y_iid , bb_iid) |
N x T |
Author(s)
Terrance Savitsky tds151@gmail.com
See Also
Examples
## Not run:
library(growfunctions)
## use gen_informative_sample() to generate an
## N X T population drawn from a dependent GP
## By default, 3 clusters are used to generate
## the population.
## A single stage stratified random sample of size n
## is drawn from the population using I = 4 strata.
## The resulting sample is informative in that the
## distribution for this sample is
## different from the population from which
## it was drawn because the strata inclusion
## probabilities are proportional to a feature
## of the response, y (in the case, the variance.
## The stratified random sample over-samples
## large variance strata).
## (The user may also select a 2-stage
## sample with the first stage
## sampling "blocks" of the population and
## the second stage sampling strata within blocks).
dat_sim <- gen_informative_sample(N = 10000,
n = 500, T = 10,
noise_to_signal = 0.1)
## extract n x T observed sample under informative
## stratified sampling design.
y_obs <- dat_sim$y_obs
T <- ncol(y_obs)
## End(Not run)