stratify: stratify

Description Usage Arguments Details Value See Also Examples

View source: R/vpcstats.R

Description

Stratification for Visual Predictive Check (VPC)

Usage

1
2
3
4
stratify(o, ...)

## S3 method for class 'tidyvpcobj'
stratify(o, formula, data = o$data, ...)

Arguments

o

tidyvpc object

...

Other arguments to include

formula

formula for stratfication

data

Observed data supplied in observed() function

Details

specify stratification variables for VPC using this function

Value

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.

See Also

observed simulated censoring predcorrect binning binless vpcstats

Examples

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

tidyvpc documentation built on Jan. 13, 2021, 6:31 a.m.