predict.mipai: Calculate Individual PAIs

Description Usage Arguments Value Examples

View source: R/methods.R

Description

Calculate Individual PAIs

Usage

1
2
## S3 method for class 'mipai'
predict(object, plot = TRUE, confint = TRUE, cores, cl, ...)

Arguments

object

an mipai or mibootpai class object returned from mi_lm_pai_cvboot.

plot

logical whether to plot a dotplot.

confint

logical whether to calculate confidence intervals. Only applies to bootstrapped model results. Defaults to TRUE.

cl

An existing cluster to use (optional)

cores

The number of cores to use when creating a cluster, if an existing cluster is not passed (optional). If left blank and no cluster passed, defaults to the number of cores available, but is only used when calculating bootstrapped confidence intervals.

dots

Additional arguments, not currently used. a label for the results.

Value

An invisible list of two elements, the “PAI” scores and the “Graph”, which is returned even if not plotted.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Not run: 
# builtin dataset with 32 cases
dat <- mtcars
dat$cyl <- factor(dat$cyl)

m <- mi_lm_pai_cvboot(~ cyl + am * (mpg + hp + drat + wt),
  "disp", "am", list(dat, dat),
  nboot = 50, holdouts = "10", cores = 2)

# use two cores to speed up when obtaining bootstrapped CIs
predict(m, cores = 2L)

## End(Not run)

JWiley/pai documentation built on May 7, 2019, 10:15 a.m.