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
Name | Description |
---|---|
data | a dataframe of QT dataset |
ydata_col | an unquoted column name of dependent variable measurements |
xdata_col | an unquoted column name of independent variable measurements |
trt_col | Optional - an unquoted column name of treatment group |
reference_threshold | optional vector of numbers to add as horizontal dashed lines |
loess_line | a bool to add LOESS regression line |
linear_line | a bool to add a linear regression line |
span | a fractional value for LOESS span parameter in geom_smooth if LOESS is used, default 0.99 |
conf_int | a fractional numeric for setting confidence interval, default = 9 |
xlabel | a string for xlabel |
ylabel | a string for xlabel |
title | a string to give plot a title |
logx | a bool to log transform the x axis |
legend | a string for legend label |
Returns
a plot
Examples
data <- preprocess(data)
eda_scatter_with_regressions(data, deltaQTCF, CONC, TRTG, reference_threshold = 10)