generics: Perform a Visual Predictive Check (VPC) computation

Description Usage Arguments Examples

Description

These functions work together to claculate the statistics that are plotted in a VPC. They would typically be chained together using the "pipe" operator (see Examples).

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15

Arguments

o

An object.

...

Additional arguments.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
## Not run: 
library(data.table)
library(magrittr)
library(vpc)

exampleobs <- as.data.table(vpc::simple_data$obs)[MDV == 0]
examplesim <- as.data.table(vpc::simple_data$sim)[MDV == 0]
exampleobs$PRED <- examplesim[REP == 1, PRED]
exampleobs$SEX <- rep(c("F", "M"), len=nrow(exampleobs))

vpc <- observed(exampleobs, x=TIME, y=DV) %>%
    simulated(examplesim, y=DV) %>%
    stratify(~ ISM) %>%
    binning(TIME) %>%
    predcorrect(pred=PRED) %>%
    vpcstats()

plot(vpc)

# Example with 2-way stratification

vpc <- vpc %>%
    stratify(SEX ~ ISM) %>%
    binning(TIME) %>%
    predcorrect(pred=PRED) %>%
    vpcstats()

plot(vpc)

## End(Not run)

smouksassi/ComputePI documentation built on Nov. 10, 2019, 2:46 p.m.