Description Usage Arguments Value
View source: R/SurrogateCohortSample.R
Creates a stratified sample based on values of stratify_var Where each partition/stratification has size denoted by n.strata
1 2 | SurrogateCohortSample(df, stratify.var = c(quo(Z1), quo(Z2)),
n.strata = c(400, 400, 0), REPLACE = FALSE)
|
df |
Input data frame |
stratify.var |
Vector of stratification variables in quo() |
n.strata |
Vector of sample sizes for each stratify.var element; last element is sample size for simple random sample |
REPLACE |
whether to sample with replacement |
sampled.df: A stratified sample with sum(n.strata) rows according to specified sampling scheme
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.