Skip to content

predict_with_quantiles_plot

Description

Plots predictions and 90% CI

Usage

predict_with_quantiles_plot(
data,
fit,
conc_col,
dv_col,
treatment_predictors,
control_predictors = NULL,
reference_threshold = c(
10
),
conf_int = 0.9,
nbins = 10,
error_bars = "CI",
xlabel = "Concentration (
ng/mL
)",
ylabel = bquote(
Delta ~ "QTc (
ms
)"
),
title = ""
)

Arguments

NameDescription
dataA dataframe of QTc dataset
fita lme model to make predictions with
conc_colan unquoted column name of concentration measurements
dv_colan unquoted column name of dQTC measurements
treatment_predictorslist of a values for contrast. CONC will update
control_predictorslist of b values for contrast
reference_thresholdoptional vector of numbers to add as horizontal dashed lines
conf_intconfidence interval fraction, default = 0.9
nbinsnumber of bins for quantiles, or vector of cut points for computing average
error_barsa string to denote which errorbars to show, CI, SE, SD or none.
xlabela string for xlabel, default “Concentration (ng/mL)“
ylabela string for ylabel, default bquote(Delta~“QTc (ms)“)
titlea string for the plot title

Returns

a plot

Examples

data <- preprocess(data)
fit <- fit_prespecified_model(
data,
deltaQTCF,
ID,
CONC,
deltaQTCFBL,
TRTG,
TAFD,
"REML",
TRUE
)
predict_with_quantiles_plot(
data,
fit,
CONC,
deltaQTCF,
treatment_predictors = list(
CONC = 0,
TRTG = "Verapamil HCL",
TAFD = "2 HR",
deltaQTCFBL = 0
)
)