Learn R Programming

stratification (version 2.2-7)

strata.tool: Functions to Visualize Stratified Designs

Description

print.strata prints a "strata" object, presenting the stratification information into a table.

plot.strata produces a histogram of the stratification variable \(X\), in which the stratification boundaries are drawn. A table with the Nh and nh values is also added at the top of the plot.

Usage

# S3 method for strata
print(x, …)

# S3 method for strata plot(x, logscale = FALSE, drop = 0, main = paste("Graphical Representation of the Stratified Design", xname), xlab, …)

Arguments

x

An object of class "strata" to print or to plot.

logscale

A logical indicating whether the \(X\) axis should be represented on the log scale or not. The default is FALSE.

drop

A integer indicating how many of the largest values of \(X\) should be omitted in the plot. This argument is useful when some large values of \(X\) stretch the \(X\) range too much.

main

A character string giving the title of the plot.

xlab

A character string naming the \(X\) axis.

Additional arguments affecting the print or the plot produced.

References

Baillargeon, S. and Rivest L.-P. (2011). The construction of stratified designs in R with the package stratification. Survey Methodology, 37(1), 53-65.

See Also

strata.bh, strata.cumrootf, strata.geo, strata.LH

Examples

Run this code
# NOT RUN {
cumrootf <- strata.cumrootf(x=MRTS, CV=0.01, Ls=4, alloc=c(0.5,0,0.5), nclass=500)
print(cumrootf)
plot(cumrootf)
plot(cumrootf, drop=5)
plot(cumrootf, logscale=TRUE)
geo <- strata.geo(x=MRTS, CV=0.01, Ls=4, alloc=c(0.5,0,0.5))
print(geo)
plot(geo, logscale=TRUE)
# The geometric method does not perform well because of some small units
LH <- strata.LH(x=MRTS, CV=0.01, Ls=4, alloc=c(0.5,0,0.5), takeall=1)
print(LH)
plot(LH, logscale=TRUE)
# }

Run the code above in your browser using DataLab