| summary.stratifyR | R Documentation |
Builds a summary of a "stratifyR" object: the design settings, the
fitted distribution and a table with one row per stratum and a total row.
summary() prints nothing itself; the result is printed by its
print() method (or automatically at the console), and
as.data.frame() returns the table.
## S3 method for class 'stratifyR'
summary(object, ...)
## S3 method for class 'summary.stratifyR'
as.data.frame(x, row.names = NULL, optional = FALSE, ...)
## S3 method for class 'summary.stratifyR'
print(x, ...)
object |
An object of class |
... |
Not used. |
x |
An object of class |
row.names, optional |
Not used; for compatibility with the generic. |
In the console, the boundary and W_h S_h columns are shown in purple
and the total row in bold gold when the console supports colour (through
the crayon package; set options(stratifyR.color = FALSE) to
turn this off). In R Markdown, the table is shown as a styled HTML table.
summary() returns an object of class "summary.stratifyR",
a list with components:
LNumber of strata.
n, NSample size and population size.
methodThe solver used.
distr, estimateThe best-fit distribution and its parameter estimates.
rangeThe smallest and largest values of the variable.
cost, chWhether stratum costs were used, and the costs.
takeall, fpc, varianceThe take-all stratum
size, whether the finite population correction was used, and the
variance of the mean (for fpc = TRUE or takeall = TRUE).
tableA data frame with one row per stratum and a total row:
the upper boundary (OSB), Wh, Vh (the stratum
variance S_h^2), WhSh, nh, Nh and fh.
print() returns x invisibly, and as.data.frame()
returns x$table.
strata.data, boundaries,
allocation, objective
data(sugarcane)
res <- strata.data(sugarcane$Production, h = 4, n = 500, method = "exact")
s <- summary(res)
s
as.data.frame(s)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.