| stratify | R Documentation |
Use to specify stratification variables for VPC.
stratify(o, ...)
## S3 method for class 'tidyvpcobj'
stratify(o, formula, data = o$data, ...)
o |
A |
... |
Other arguments to include. |
formula |
Formula for stratification. |
data |
Observed data supplied in |
Returns updated tidyvpcobj with stratification formula, stratification column(s), and strat.split datasets, which
is obs split by unique levels of stratification variable(s). Resulting datasets are of class object data.frame
and data.table.
observed simulated censoring predcorrect binning binless vpcstats
require(magrittr)
vpc <- observed(obs_data, x=TIME, y=DV) %>%
simulated(sim_data, y=DV) %>%
stratify(~ GENDER) %>%
binning(NTIME) %>%
vpcstats()
# Example with 2-way stratification by GENDER and STUDY.
vpc <- vpc %>%
stratify(~ GENDER + STUDY) %>%
binning(bin = "centers", centers = c(1,3,5,7,10)) %>%
vpcstats()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.