Description Usage Arguments Examples
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).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
o |
An object. |
... |
Additional arguments. |
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.