Skip to content

eda_scatter_with_regressions

Description

plots scatter plot with with linear and loess regressions. Can be used to check for linearity.

Usage

eda_scatter_with_regressions(
data,
ydata_col,
xdata_col,
trt_col = NULL,
reference_threshold = NULL,
loess_line = TRUE,
linear_line = TRUE,
span = 0.99,
conf_int = 0.9,
xlabel = "Concentration (
ng/mL
)",
ylabel = bquote(
Delta ~ "QTc (
ms
)"
),
title = "",
logx = FALSE,
legend = ""
)

Arguments

NameDescription
dataa dataframe of QT dataset
ydata_colan unquoted column name of dependent variable measurements
xdata_colan unquoted column name of independent variable measurements
trt_colOptional - an unquoted column name of treatment group
reference_thresholdoptional vector of numbers to add as horizontal dashed lines
loess_linea bool to add LOESS regression line
linear_linea bool to add a linear regression line
spana fractional value for LOESS span parameter in geom_smooth if LOESS is used, default 0.99
conf_inta fractional numeric for setting confidence interval, default = 9
xlabela string for xlabel
ylabela string for xlabel
titlea string to give plot a title
logxa bool to log transform the x axis
legenda string for legend label

Returns

a plot

Examples

data <- preprocess(data)
eda_scatter_with_regressions(data, deltaQTCF, CONC, TRTG, reference_threshold = 10)