summary.strata: Summarise a stratification

summary.stratifyRR Documentation

Summarise a stratification

Description

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.

Usage

## 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, ...)

Arguments

object

An object of class "stratifyR", from strata.data or strata.distr.

...

Not used.

x

An object of class "summary.stratifyR".

row.names, optional

Not used; for compatibility with the generic.

Details

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.

Value

summary() returns an object of class "summary.stratifyR", a list with components:

L

Number of strata.

n, N

Sample size and population size.

method

The solver used.

distr, estimate

The best-fit distribution and its parameter estimates.

range

The smallest and largest values of the variable.

cost, ch

Whether stratum costs were used, and the costs.

takeall, fpc, variance

The take-all stratum size, whether the finite population correction was used, and the variance of the mean (for fpc = TRUE or takeall = TRUE).

table

A 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.

See Also

strata.data, boundaries, allocation, objective

Examples


data(sugarcane)
res <- strata.data(sugarcane$Production, h = 4, n = 500, method = "exact")
s <- summary(res)
s
as.data.frame(s)


stratifyR documentation built on Nov. 13, 2026, 9:06 a.m.