strata.tool: Functions to Visualize Stratified Designs

Description Usage Arguments Note Author(s) References See Also Examples

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

1
2
3
4
5
6
7
## S3 method for class 'strata'
print(x, ...)

## S3 method for class '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.

Note

When the object of class "strata" contains a certainty stratum, plot.strata removes from the data the units in this stratum before generating the histogram.

Author(s)

Sophie Baillargeon Sophie.Baillargeon@mat.ulaval.ca and
Louis-Paul Rivest Louis-Paul.Rivest@mat.ulaval.ca

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
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)

Example output

Given arguments:
x = MRTS
nclass = 500, CV = 0.01, Ls = 4
allocation: q1 = 0.5, q2 = 0, q3 = 0.5
model = none

Strata information:
          |      type rh |        bh     E(Y)     Var(Y)   Nh  nh   fh
stratum 1 | take-some  1 |   9865.74  5890.56    6376633  778  87 0.11
stratum 2 | take-some  1 |  19590.24 14144.66    7508233  742  90 0.12
stratum 3 | take-some  1 |  40984.15 26480.44   31329795  355  88 0.25
stratum 4 |  take-all  1 | 486367.49 74294.75 2916366192  125 125 1.00
Total                                                    2000 390 0.20

Total sample size: 390 
Anticipated population mean: 16882.8 
Anticipated CV: 0.009977894 
Given arguments:
x = MRTS
CV = 0.01, Ls = 4
allocation: q1 = 0.5, q2 = 0, q3 = 0.5
model = none

Strata information:
          |      type rh |        bh      E(Y)       Var(Y)   Nh  nh   fh
stratum 1 | take-some  1 |   1081.91    648.10 7.312548e+04   25   1 0.04
stratum 2 | take-some  1 |   8288.00   5212.28 3.891455e+06  587  67 0.11
stratum 3 | take-some  1 |  63490.22  18932.90 1.133011e+08 1343 824 0.61
stratum 4 |  take-all  1 | 486367.49 116953.15 5.182641e+09   45  45 1.00
Total                                                       2000 937 0.47

Total sample size: 937 
Anticipated population mean: 16882.8 
Anticipated CV: 0.009982524 
Given arguments:
x = MRTS
CV = 0.01, Ls = 4, takenone = 0, takeall = 1
allocation: q1 = 0.5, q2 = 0, q3 = 0.5
model = none
algo = Kozak: minsol = 1000, idopti = nh, minNh = 2, maxiter = 10000, 
              maxstep = 100, maxstill = 500, rep = 5, trymany = TRUE

Strata information:
          |      type rh |        bh     E(Y)     Var(Y)   Nh  nh   fh
stratum 1 | take-some  1 |   9801.28  5875.32    6341054  775  77 0.10
stratum 2 | take-some  1 |  18176.38 13634.64    5784372  674  64 0.09
stratum 3 | take-some  1 |  33560.07 23555.62   16343023  374  60 0.16
stratum 4 |  take-all  1 | 486367.49 63348.42 2348818733  177 177 1.00
Total                                                    2000 378 0.19

Total sample size: 378 
Anticipated population mean: 16882.8 
Anticipated CV: 0.009986099 
Note: CV=RRMSE (Relative Root Mean Squared Error) because takenone=0.

stratification documentation built on May 1, 2019, 9:13 p.m.