powered by
For strata defined by multiple variables (e.g. sex,age,country) one combined variable is generated.
generateStrata(df, stratavars, name)
The original data set with one new column.
a data.frame
character vector with variable name
name of the newly generated variable
Alexander Kowarik
x <- testdata x <- generateStrata(x,c("sex","urbrur"),"strataIDvar") head(x)
Run the code above in your browser using DataLab