stratify: Stratify data

Description Usage Arguments Value Methods Author(s) See Also Examples

Description

Generic function for stratifying data.

Usage

1
stratify(x, design)

Arguments

x

the data.frame to be stratified.

design

a character, logical or numeric vector specifying the variables (columns) to be used for stratification.

Value

An object of class "Strata".

Methods

x = "data.frame", design = "BasicVector"

stratify data according to the variables (columns) given by design.

Author(s)

Andreas Alfons

See Also

"Strata"

Examples

1
2
3
data(eusilcP)
strata <- stratify(eusilcP, c("region", "gender"))
summary(strata)

Example output

Loading required package: Rcpp
Loading required package: lattice
Loading required package: parallel
          region gender Size
1     Burgenland   male  947
2  Lower Austria   male 5547
3         Vienna   male 5546
4      Carinthia   male 1950
5         Styria   male 3994
6  Upper Austria   male 5085
7       Salzburg   male 1954
8          Tyrol   male 2257
9     Vorarlberg   male 1259
10    Burgenland female  994
11 Lower Austria female 5580
12        Vienna female 6111
13     Carinthia female 2161
14        Styria female 4148
15 Upper Austria female 5225
16      Salzburg female 2071
17         Tyrol female 2539
18    Vorarlberg female 1286

simFrame documentation built on Oct. 14, 2021, 5:24 p.m.