plot.bmbstats_RCT_predict: S3 method for plotting 'RCT_predict' results

Description Usage Arguments Examples

View source: R/rct-predict-S3.R

Description

S3 method for plotting RCT_predict results

Usage

1
2
## S3 method for class 'bmbstats_RCT_predict'
plot(x, type = "residuals", ...)

Arguments

x

Object of class bmbstats_RCT_predict

type

Type of plot. Options are "residuals", "prediction", "bias-variance", "pdp+ice", "counterfactual", and "ice". Default is "residuals"

...

Extra arguments. Use control argument and plot_control function to control plotting style. confidence for setting confidence level, metric for selecting performance metric (default is "RMSE") and metric_CV for selecting source of CV metrics (defaults is "testing.pooled"). For "pdp+ice", use predictor to select predictor for plotting (default is group parameter from RCT_predict).

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
data("vertical_jump_data")

m1 <- cv_model(
  `Post-test` ~ `Pre-test` + Group,
  vertical_jump_data,
  control = model_control(
    cv_repeats = 10,
    cv_folds = 3,
    cv_strata = vertical_jump_data$Group
  )
)

m1_rct <- RCT_predict(
  m1,
  new_data = vertical_jump_data,
  outcome = "Post-test",
  group = "Group",
  treatment_label = "Treatment",
  control_label = "Control"
)

m1_rct
plot(m1_rct)

mladenjovanovic/bmbstats documentation built on Aug. 5, 2020, 4:20 p.m.