| accessors | R Documentation |
These functions return the main results of strata.data,
strata.distr and compare_designs, so that the
internal structure of the returned objects need not be used.
boundaries(x, ...)
## S3 method for class 'stratifyR'
boundaries(x, ends = FALSE, ...)
allocation(x, ...)
## S3 method for class 'stratifyR'
allocation(x, ...)
## S3 method for class 'stratifyR'
as.data.frame(x, row.names = NULL, optional = FALSE, ...)
objective(x, ...)
## S3 method for class 'stratifyR'
objective(x, ...)
## S3 method for class 'compare_designs'
objective(x, ...)
variance(x, ...)
## S3 method for class 'stratifyR'
variance(x, ...)
fitted_distribution(x, ...)
## S3 method for class 'stratifyR'
fitted_distribution(x, ...)
## S3 method for class 'compare_designs'
as.data.frame(x, row.names = NULL, optional = FALSE, ...)
x |
An object of class |
... |
Not used. |
ends |
Logical. If |
row.names, optional |
Not used; for compatibility with the generic. |
boundaries() returns the optimum strata boundaries (OSB): the
L - 1 cut points between the L strata, or, with
ends = TRUE, the L + 1 values from the smallest to the
largest value of the variable.
allocation() returns one row per stratum, with the lower and upper
boundary, the population size N_h, the weight W_h = N_h/N, the
standard deviation S_h, the product W_h S_h, the sample size
n_h and the sampling fraction f_h = n_h/N_h.
as.data.frame() on a "stratifyR" object gives the same table.
objective() returns the value of the objective function
\Phi = \sum_h W_h S_h at the boundaries, the quantity that the
solvers minimise.
variance() returns the variance of the estimated population mean
under the design, with the finite population correction:
V = \sum_h W_h^2 S_h^2 (1/n_h - 1/N_h), where a stratum that is
sampled completely adds nothing.
fitted_distribution() returns the name of the best-fit distribution
and its parameter estimates on the scale of the data.
For a "compare_designs" object, as.data.frame() returns one
row per design (SRS, proportional and Neyman allocation), with the
variance and standard error of the sample mean and the design effect, and
objective() returns \Phi.
boundaries(), objective() and variance()
return numeric values,
allocation() and as.data.frame() return data frames, and
fitted_distribution() returns a list with components
distr and estimate.
strata.data, summary.stratifyR,
compare_designs
data(sugarcane)
res <- strata.data(sugarcane$Production, h = 4, n = 500, method = "exact")
boundaries(res)
allocation(res)
objective(res)
variance(res)
fitted_distribution(res)
as.data.frame(compare_designs(res))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.