Type: | Package |
Date: | 2021-08-16 |
Title: | Dose Response Data Analysis using the 4 Parameter Logistic (4pl) Model |
Version: | 2.0.0 |
Depends: | R (≥ 3.1.0) |
Description: | Models the relationship between dose levels and responses in a pharmacological experiment using the 4 Parameter Logistic model. Traditional packages on dose-response modelling such as 'drc' and 'nplr' often draw errors due to convergence failure especially when data have outliers or non-logistic shapes. This package provides robust estimation methods that are less affected by outliers and other initialization methods that work well for data lacking logistic shapes. We provide the bounds on the parameters of the 4PL model that prevent parameter estimates from diverging or converging to zero and base their justification in a statistical principle. These methods are used as remedies to convergence failure problems. Gadagkar, S. R. and Call, G. B. (2015) <doi:10.1016/j.vascn.2014.08.006> Ritz, C. and Baty, F. and Streibig, J. C. and Gerhard, D. (2015) <doi:10.1371/journal.pone.0146021>. |
License: | GPL-2 | GPL-3 [expanded from: GPL (≥ 2)] |
LazyData: | TRUE |
URL: | https://bitbucket.org/dittmerlab/dr4pl |
BugReports: | https://bitbucket.org/dittmerlab/dr4pl/issues?status=new&status=open |
RdMacros: | Rdpack |
RoxygenNote: | 7.1.1 |
Encoding: | UTF-8 |
Imports: | ggplot2, Matrix, tensor, Rdpack, generics, rlang, glue |
Suggests: | drc, devtools, roxygen2, testthat, knitr, rmarkdown, tibble |
VignetteBuilder: | knitr |
NeedsCompilation: | no |
Packaged: | 2021-08-17 13:49:51 UTC; jtlandis |
Author: | Justin T. Landis [aut, cre], Alice Peng [ctb], Hyowon An [aut], Aubrey G. Bailey [aut], Dirk P. Dittmer [aut], James S. Marron [aut] |
Maintainer: | Justin T. Landis <jtlandis314@gmail.com> |
Repository: | CRAN |
Date/Publication: | 2021-08-17 16:10:18 UTC |
FindHillBounds
Description
Compute the Hill bounds based on initial parameter estimates and data.
Usage
FindHillBounds(x, y, theta, use.Hessian = FALSE, level = 0.9999)
Arguments
x |
Vector of doses. |
y |
Vector of responses. |
theta |
Parameters of a 4PL model. |
use.Hessian |
Indicator of whether the Hessian matrix (TRUE) or the gradient vector is used in confidence interval computation. |
level |
Confidence level to be used in computing the Hill bounds. |
Details
This function computes the Hill bounds based on initial parameter
estimates and data. It basically computes the confidence intervals of the
true parameters based on the variance-covariance matrix of a given initial
parameter estimates. The half of a hessian matrix is used as a
variance-covariance matrix. If matrix inversion of the variance-covariance matrix
is infeasible, a variation of the method in Wang et al. (2010) is used. The
parameter level
is only for simulation.
Value
Data frame whose first column represents the bounds on the IC50 parameter in log 10 scale and second column represents the bounds on the slope parameter.
Author(s)
Hyowon An, ahwbest@gmail.com.
References
Higham NJ (2002). “Computing the nearest correlation matrix—a problem from finance.” IMA J. Numer. Anal., 22(3), 329–343. ISSN 0272-4979, doi: 10.1093/imanum/22.3.329, http://dx.doi.org.libproxy.lib.unc.edu/10.1093/imanum/22.3.329. Wang Y, Jadhav A, Southal N, Huang R, Nguyen DT (2010). “A grid algorithm for high throughput fitting of dose-response curve data.” Curr Chem Genomics, 4, 57–66.
See Also
FindInitialParms
, FindLogisticGrids
.
FindInitialParms
Description
Find initial parameter estimates for a 4PL model.
Usage
FindInitialParms(
x,
y,
trend = "auto",
method.init = "Mead",
method.robust = "squared"
)
Arguments
x |
Vector of dose levels |
y |
Vector of responses |
trend |
Indicator of whether the curve is a decreasing |
method.init |
Method of obtaining initial values of the parameters. See
|
method.robust |
Parameter to select loss function for the robust estimation
method to be used to fit a model. See |
Value
Initial parameter estimates of a 4PL model in the order of the upper asymptote, IC50, Slope and lower asymptote parameters.
FindLogisticGrids
Description
Compute the grids on the upper and lower asymptote parameters for the logistic method based on initial parameter estimates and data.
Usage
FindLogisticGrids(x, y, retheta.init, use.Hessian = FALSE)
Arguments
x |
Vector of doses. |
y |
Vector of responses. |
retheta.init |
Parameters of a 4PL model among which the EC50 parameter is in the log 10 dose scale. |
use.Hessian |
Indicator of whether the Hessian matrix (TRUE) or the gradient vector is used in confidence interval computation. |
Details
This function computes the grids on the upper and lower asymptote parameters based on initial parameter estimates and data. It basically computes the confidence intervals of the true parameters based on the variance-covariance matrix of the given initial parameter estimates. If matrix inversion of the variance-covariance matrix is infeasible, a variation of the method in Wang et al. (2010) is used.
Value
Data frame whose first column represents the grid on the upper asymptote parameter and second column represents the grid o the lower asymptote.
Author(s)
Hyowon An
References
Wang Y, Jadhav A, Southal N, Huang R, Nguyen DT (2010). “A grid algorithm for high throughput fitting of dose-response curve data.” Curr Chem Genomics, 4, 57–66.
See Also
FindHillBounds
, FindInitialParms
Obtain Inhibitory Concentrations (IC) of a dose-response curve
Description
This function obtains estimates of the IC's of a dose-response curve. Typically the IC50 parameter is of interest, but sometimes IC10 or IC90 are important aspects of a dose-response curve. By controlling the function argument, a user can obtain the IC's at various levels.
Usage
IC(object, inhib.percent)
Arguments
object |
Object of the class 'dr4pl' for which the IC values are obtained |
inhib.percent |
Inhibited percentages at which thc IC values are obtained |
Value
IC values at the inhibited percentages provided by the argument
inhib.percent
Examples
data.test <- data.frame(x = c(0.0001, 0.001, 0.01, 0.1, 1),
y = c(10, 9, 5, 1, 0))
obj.dr4pl <- dr4pl(y ~ x,
data = data.test)
IC(obj.dr4pl, inhib.percent = c(10, 90))
obj.dr4pl <- dr4pl(Response ~ Dose, data = sample_data_4) # Fit a 4PL model to data
IC(obj.dr4pl, inhib.percent = c(10, 50, 90))
Compute an estimated mean response.
Description
Compute an estimated mean response.
Usage
MeanResponse(...)
## S3 method for class 'dr4pl'
MeanResponse(dr4pl, theta = NULL, ...)
## S3 method for class 'numeric'
MeanResponse(theta, x, ...)
## S3 method for class 'dr4pl_theta'
MeanResponse(theta, x, ...)
## S3 method for class 'dr4pl_log10'
MeanResponse(theta, x, ...)
Arguments
... |
arguments to be passed to S3 methods |
dr4pl |
dr4pl object |
theta |
Parameters of the dr4pl object. Usually made with [dr4pl_theta] |
x |
domain values for 4PL model. Values should always be passed to this function on the linear space. |
Value
Predicted response values.
Detect outliers by the method of Motulsky and Brown (2006).
Description
Detect outliers by the method of Motulsky and Brown (2006).
Usage
OutlierDetection(residuals)
Arguments
residuals |
Vector of residuals from a robust fit. |
Details
This function detects outliers from a vector of residuals obtained from a robust fit. The method used here is the same with Motulsky and Brown (2006) except that the median absolute deviation is used instead of the sample quantile based estimator suggested in that paper. Based on the False Discovery Rate (FDR) a set of multiple outliers that have lower FDR's than a threshold are reported.
Value
Vector of indices of outliers in the input vector of residuals
Author(s)
Hyowon An
References
Motulsky HJ, Brown RE (2006). “Detecting outliers when fitting data with nonlinear regression - a new method based on robust nonlinear regression and the false discovery rate.” BMC Bioinformatics, 7, 123.
dr4pl-calculate
Description
calculate various useful statistics.
Usage
## S3 method for class 'dr4pl'
calculate(x, parm = NULL, level = 0.95, ...)
Arguments
x |
an object of class 'dr4pl' |
parm |
parameters of the dr4pl object. Usually made with [dr4pl_theta] |
level |
confidence level to calculate. Defaults to 0.95 |
... |
extra arguments to be passed to [vcov.dr4pl] |
Obtain coefficients of a 4PL model
Description
This function obtains the coefficients of a 4PL model. Estimates of the four parameters, the upper asymptote, IC50, slope and lower asymptote, are returned.
Usage
## S3 method for class 'dr4pl'
coef(object, ...)
Arguments
object |
A 'dr4pl' object |
... |
arguments passed to coef |
Value
A vector of parameters
Examples
obj.dr4pl <- dr4pl(Response ~ Dose, data = sample_data_2) # Fit a 4PL model to data
coef(obj.dr4pl) # Print parameter estimates
obj.dr4pl <- dr4pl(Response ~ Dose, data = sample_data_3) # Fit a 4PL model to data
coef(obj.dr4pl) # Print parameter estimates
Fit a 4 parameter logistic (4PL) model to dose-response data.
Description
Compute the approximate confidence intervals of the parameters of a 4PL model based on the asymptotic normality of least squares estimators.
Usage
## S3 method for class 'dr4pl'
confint(object, parm = NULL, level = 0.95, ...)
Arguments
object |
An object of the dr4pl class |
parm |
parameters of the dr4pl object. Usually made with [dr4pl_theta] |
level |
Confidence level |
... |
Other parameters to be passed to vcov |
Details
This function computes the approximate confidence intervals of the true parameters of a 4PL model based on the asymptotic normality of the least squares estimators in nonlinear regression. The Hessian matrix is used to obtain the second order approximation to the sum-of-squares loss function. Please refer to Subsection 5.2.2 of Seber and Wild (1989).
Value
A matrix of the confidence intervals in which each row represents a parameter and each column represents the lower and upper bounds of the confidence intervals of the corresponding parameters.
References
Seber GAF, Wild CJ (1989). Nonlinear regression, Wiley Series in Probability and Mathematical Statistics: Probability and Mathematical Statistics. John Wiley \& Sons, Inc., New York. ISBN 0-471-61760-1, doi: 10.1002/0471725315, http://dx.doi.org.libproxy.lib.unc.edu/10.1002/0471725315.
Examples
obj.dr4pl <- dr4pl(Response ~ Dose, data = sample_data_1) # Fit a 4PL model to data
## Use the data 'sample_data_1' to obtain confidence intervals.
confint(obj.dr4pl) # 95% confidence intervals
confint(obj.dr4pl, level = 0.99) # 99% confidence intervals
theta <- FindInitialParms(x = sample_data_1$Dose, y = sample_data_1$Response)
# Use the same data 'sample_data_1' but different parameter estimates to obtain
# confidence intervals.
confint(obj.dr4pl, parm = theta)
Fitting 4 Parameter Logistic (4PL) models to dose-response data.
Description
This function fits a 4PL model to dose-response data. Users can obtain fitted parameter estimates as return values. Using auxiliary functions provided by this R package, users can plot a fitted dose-response curve and obtain confidence intervals of true parameters. In addition, the goodness-of-fit test for model adequacy of the 4PL models can be performed when replicates are available for each dose level.
Usage
dr4pl(...)
## S3 method for class 'formula'
dr4pl(
formula,
data = list(),
init.parm = dr4pl_theta(),
trend = "auto",
method.init = "Mead",
method.robust = "squared",
method.optim = "Nelder-Mead",
use.Hessian = FALSE,
level = 0.9999,
failure.message = FALSE,
upperl = NULL,
lowerl = NULL,
...
)
## S3 method for class 'data.frame'
dr4pl(
data,
dose,
response,
init.parm = dr4pl_theta(),
trend = "auto",
method.init = "Mead",
method.robust = "squared",
method.optim = "Nelder-Mead",
use.Hessian = FALSE,
level = 0.9999,
failure.message = FALSE,
upperl = NULL,
lowerl = NULL,
...
)
## Default S3 method:
dr4pl(
dose,
response,
init.parm = dr4pl_theta(),
trend = "auto",
method.init = "Mead",
method.robust = "squared",
method.optim = "Nelder-Mead",
use.Hessian = FALSE,
level = 0.9999,
failure.message = FALSE,
upperl = NULL,
lowerl = NULL,
...
)
Arguments
... |
Further arguments to be passed to |
formula |
Symbolic description of the model to be fit. Either of the form 'response ~ dose' or as a data frame with response values in first column and dose values in second column. |
data |
Data frame containing variables in the model. |
init.parm |
Either a call to [dr4pl_theta], or a Vector of initial parameters to be optimized in the model.
dr4pl assumes |
trend |
Indicator of whether a dose-response curve is a decreasing
|
method.init |
Method of obtaining initial values of the parameters. If this parameter is left unassigned, a default "Mead" method will be used. Assign "logistic" to use the logistic method. |
method.robust |
Parameter to select loss function for the robust estimation method to be used to fit a model. The argument NULL indicates the sum of squares loss, "absolute" indicates the absolute deviation loss, "Huber" indicates Huber's loss and "Tukey" indicates Tukey's biweight loss. |
method.optim |
Method of optimization of the loss function specified by
|
use.Hessian |
Indicator of whether the Hessian matrix (TRUE) or the gradient vector is used in the Hill bounds. |
level |
Confidence level to be used in Hill bounds computation. |
failure.message |
Indicator of whether a message indicating attainment of the Hill bounds and possible resolutions will be printed to the console (TRUE) or hidden (FALSE). |
upperl |
Either NULL or a numeric vector of length 4 that specifies the upper limit
for the initial parameters of |
lowerl |
Either NULL or a numeric vector of length 4 that specifies the lower limit
for the initial parameters of |
dose |
Vector of dose levels |
response |
Vector of responses |
Details
This function fits a 4 parameter logistic (4PL) model to dose-response data. A formula of the model is
\theta[1]+(\theta[4]-\theta[1])/(1+(z/\theta[2])^\theta[3])
method.init
specifies an initialization method to get initial parameter
estimates based on data. The currently supported initialization methods are
"logistic" and 'Mead'. For further details, see the vignette.
method.optim
specifies an optimization method to be used in
"constrOptim" function. The currently supported optimization techniques
include "Nelder-Mead", "BFGS", "CG", "L-BFGS-B", "SANN" and "Brent". For
further details, see the help page of optim
.
method.robust
chooses a robust estimation method among 4 methods.
The method of estimation is usually identified by the loss function of the
method. This package supports 4 types of loss functions: sum-of-squares loss,
absolute deviation loss, Huber's loss and Tukey's biweight loss. Each of
loss function is explained in detail in the vignette.
Value
A 'dr4pl' object for which "confint", "gof", "print" and "summary"
methods are implemented. For details, see the help page of each method.
For example, type ?confint.dr4pl
to obtain the confidence intervals
of parameters of the 'dr4pl' object.
Methods (by class)
-
formula
: General 4PL model fitting function for analysis of dose-response relation. -
data.frame
: Method for when formula argument is missing. dose and response arguments are necessary -
default
: Used in the default case, supplying a single dose and response variable
Author(s)
Hyowon An, ahwbest@gmail.com
Justin T. Landis, jtlandis314@gmail.com
Aubrey G. Bailey, aubreybailey@gmail.com
See Also
confint.dr4pl
, gof.dr4pl
,
print.dr4pl
, summary.dr4pl
Examples
##Assign method.init = "logistic" to use logistic method of estimation.
##default method
a <- dr4pl(dose = sample_data_1$Dose,
response = sample_data_1$Response,
method.init = "logistic")
plot(a)
##Use default or Assign method.init = "Mead" to use Mead's method of estimation.
# Use method.robust to select desired loss function
# formula method
b <- dr4pl(formula = Response~Dose,
data = sample_data_4,
method.init = "Mead",
method.robust = "Tukey" )
plot(b)
#data.frame method
c <- dr4pl(data = sample_data_10,
dose = Dose,
response = Response)
plot(c)
##compatable with ggplot
library(ggplot2) #load ggplot2
c <- dr4pl(Response~Dose,
data = drc_error_2,
method.optim = "CG",
trend = "decreasing" )
d <- plot(c, x.breaks = c(.00135, .0135, .135, 1.35, 13.5))
d + theme_grey()
Augment data with dr4pl
Description
Augment data with dr4pl
Usage
## S3 method for class 'dr4pl'
augment(x, data = NULL, ...)
Arguments
x |
dr4pl object |
data |
new data to use |
... |
For future extension. Should not be used. |
Constructor for dr4pl theta parameter
Description
As of version 2.0.0, dr4pl will require the theta parameter to be made by this function. This is to ensure the user is explicit about what their parameter is, and what is being optimized.
Usage
dr4pl_theta(
theta_1 = NA,
theta_2 = NA,
theta_3 = NA,
theta_4 = NA,
isLog10 = FALSE
)
ParmToLog(x)
## S3 method for class 'dr4pl_theta'
ParmToLog(x)
## S3 method for class 'dr4pl_log10'
ParmToLog(x)
LogToParm(x)
## S3 method for class 'dr4pl_theta'
LogToParm(x)
## S3 method for class 'dr4pl_log10'
LogToParm(x)
Arguments
theta_1 |
Numeric. The upper asymptote of the 4pl model. |
theta_2 |
Numeric. The value where Response is half way between the upper and lower asymptotes. This parameter is other wise known as IC50/EC50. |
theta_3 |
Numeric. The slope of the 4pl model. When 'theta_3>0' the curve increases, and when 'theta_3<0', the curve decreases. |
theta_4 |
Numeric. The lower asymptote of the 4pl model. |
isLog10 |
Logical value indicating if the second parameter is on the log10 scale. The default, FALSE, informs dr4pl that the value passed to the 'theta_2' argument is on the linear scale. TRUE will indicate that 'theta_2' has already been transformed with log10. This ensures that the parameters are handled properly later on. |
x |
a dr4pl_param object |
Details
The function 'dr4pl_theta' is a constructor function for the end user. While the default values for 'theta_1', 'theta_2', 'theta_3', 'theta_4' are 'NA', certain functions of 'dr4pl' will not allow 'NA' values. When 'dr4pl_theta' is used with the 'init.parm' argument of [dr4pl], then values with 'NA' will be estimated, and those specified, will be set as the initial parameter prior to optimization. If 'dr4pl_theta' is the object of S3 dispatch, then no NA values are allowed. However if the object if dispatch is a 'dr4pl' object, and 'dr4pl_theta' is passed into the function as an additional object such as in [X], [Y], then parameter non-NA values will be replaced in the appropriate dr4pl parameter estimates for the purpose of said function.
Value
an object of class '"dr4pl_param"'
Private function to fit the 4PL model to dose-response data
Description
Private function that actually fits the 4PL model to data. If the
Hill bounds are attained at the end of optimization processes, then an
indicator of convergence failure so that dr4pl.default
can
look for a remedy for convergence failure.
Usage
dr4plEst(
dose,
response,
init.parm,
trend,
method.init,
method.optim,
method.robust,
use.Hessian,
level,
upperl,
lowerl,
...
)
Arguments
dose |
Vector of dose levels |
response |
Vector of responses |
init.parm |
Vector of initial parameters of the 4PL model supplied by a user. |
trend |
Indicator of whether a dose-response curve is a decreasing
|
method.init |
Method of obtaining initial values of the parameters. Should be one of "logistic" for the logistic method or "Mead" for the Mead method. The default option is the Mead method. |
method.optim |
Method of optimization of the parameters. This argument
is directly delivered to the |
method.robust |
Parameter to select loss function for the robust estimation method to be used to fit a model. The argument NULL indicates the sum of squares loss, "absolute" indicates the absolute deviation loss, "Huber" indicates Huber's loss and "Tukey" indicates Tukey's biweight loss. |
use.Hessian |
Indicator of whether the Hessian matrix (TRUE) or the gradient vector is used in the Hill bounds. |
level |
Confidence level to be used in Hill bounds computation. |
upperl |
upper limit to init.parm |
lowerl |
lower limit to init.parm |
... |
Further arguments to be passed to |
Value
List of final parameter estimates, name of robust estimation, loss value and so on.
Single High Outlier
Description
These are a handful of experimentally derived datasets from the wet-laboratory. These all have numerical errors in other dose-response curve-packages, but not using these methods. This data set exemplifies the case of a single extreme outlier of one dose measurement.
Examples
a <- dr4pl(Response~Dose, data = drc_error_1, method.init = "logistic", method.robust = "Tukey")
plot(a)
Multiple High Outliers at Different measurements
Description
These are a handful of experimentally derived datasets from the wet-laboratory. These all have numerical errors in other dose-response curve-packages, but not using these methods. This data set exemplifies the case of multiple outliers as well as a small number of observations per dose measurement.
Examples
a <- dr4pl(Response~Dose, data = drc_error_2, trend = "decreasing", method.optim = "CG")
plot(a)
Support Problem and Outliers at a Single Dose Level
Description
These are a handful of experimentally derived datasets from the wet-laboratory. These all have numerical errors in other dose-response curve-packages, but not using these methods. This data set exemplifies the case of multiple outliers at a single dose measurement as well as the support problem.
Examples
a <- dr4pl(Response~Dose, data = drc_error_3, method.init = "Mead", method.robust = "Huber")
plot(a)
Support Problem
Description
These are a handful of experimentally derived datasets from the wet-laboratory. These all have numerical errors in other dose-response curve-packages, but not using these methods. This data set exemplifies the support problem.
Examples
a <- dr4pl(Response~Dose, data = drc_error_4, method.init = "logistic")
plot(a)
Perform the goodness-of-fit (gof) test for a model.
Description
S3 method for a model object
Usage
gof(object, ...)
Arguments
object |
A model object |
... |
dots for future extensions |
Value
data.frame with goodness-of-fit results
Perform the goodness-of-fit (gof) test for the 4PL model.
Description
Perform the goodness-of-fit (gof) test for the 4PL model when there are at least two replicates for each dose level.
Usage
## S3 method for class 'dr4pl'
gof(object, n.signif.digit = 4, ...)
Arguments
object |
An object of the dr4pl class. |
n.signif.digit |
Number of significant digits after the decimal point to be printed. The default value is 4, but users can change the value on their own. |
... |
dots for future extensions |
Details
Perform a goodness-of-fit (gof) test for the goodness of the 4PL models for dose-response data. There should be at least two replicates at each dose level. The test statistic follows the F distribution with degress of freedom (n - 4) and (N - n) where N stands for the total number of observations and n stands for the number of dose levels. For detailed explanation of the method, please refer to Subsection 2.1.5 of Seber and Wild (1989).
Value
A list of results in the order of a F-statistic value, p-value and a degree of freedom.
References
Seber GAF, Wild CJ (1989). Nonlinear regression, Wiley Series in Probability and Mathematical Statistics: Probability and Mathematical Statistics. John Wiley \& Sons, Inc., New York. ISBN 0-471-61760-1, doi: 10.1002/0471725315, http://dx.doi.org.libproxy.lib.unc.edu/10.1002/0471725315.
Examples
obj.dr4pl <- dr4pl(Response ~ Dose, data = sample_data_4) # Fit a 4PL model to data
gof(obj.dr4pl) # Print the goodness-of-fit test results
Make a plot of a 4PL model curve and data
Description
This function displays a dose-response curve and data. As a default, the x-axis represents dose levels in log 10 scale and the y-axis represents responses. The black solid line represents a dose-response curve. The blue filled circles represent data points and red triangles represent outliers.
Usage
## S3 method for class 'dr4pl'
plot(
x,
type.curve = "all",
text.title = "Dose-response plot",
text.x = "Dose",
text.y = "Response",
indices.outlier = NULL,
breaks.x = NULL,
breaks.y = NULL,
...
)
Arguments
x |
‘dr4pl’ object whose data and mean response function will be plotted. |
type.curve |
Indicator of the type of a dose-response curve. "all" indicates that data and a curve will be plotted while "data" indicates that only data will be plotted. |
text.title |
Character string for the title of a plot with a default set to "Dose response plot". |
text.x |
Character string for the x-axis of the plot with a default set to "Dose". |
text.y |
Character string for the y-axis of the plot with a default set to "Response". |
indices.outlier |
Pass a vector indicating all indices which are outliers in the data. |
breaks.x |
Vector of desired break points for the x-axis |
breaks.y |
Vector of desired break points for the y-axis |
... |
All arguments that can normally be passed to ggplot. |
Author(s)
Hyowon An, ahwbest@gmail.com
Justin T. Landis, jtlandis314@gmail.com
Aubrey G. Bailey, aubreybailey@gmail.com
Examples
## Not run:
dr4pl.1 <- dr4pl(Response ~ Dose, data = sample_data_1)
plot(dr4pl.1)
## Able to further edit plots.
library(ggplot2) #needed to change color to green
dr4pl.1 <- dr4pl(Response ~ Dose,
data = sample_data_1,
text.title = "Sample Data Plot")
a <- plot(dr4pl.1)
a + geom_point(color = "green", size = 5)
## Bring attention to outliers using parameter indices.outlier.
dr4pl.3 <- dr4pl(Response ~ Dose,
data = drc_error_3,
method.init = "Mead",
method.robust = "absolute")
plot(dr4pl.3, indices.outlier = c(90, 101))
## Change the plot title default with parameter text.title.
dr4pl.1 <- dr4pl::dr4pl(Response ~ Dose,
data = sample_data_1)
plot(dr4pl.1, text.title = "My New Dose Response plot")
##Change the labels of the x and y axis to your need
library(drc) # Needed to load 'decontaminants' data set
data.hpc <- subset(decontaminants, group %in% "hpc")
dr4pl.hpc <- dr4pl(count~conc, data = data.hpc)
plot(dr4pl.hpc,
text.title = "hpc Decontaminants Plot",
text.x = "Concentration",
text.y = "Count")
## End(Not run)
Print the dr4pl object to screen.
Description
Print the dr4pl object to screen.
Usage
## S3 method for class 'dr4pl'
print(x, ...)
Arguments
x |
a dr4pl object to be printed |
... |
all normally printable arguments |
Examples
ryegrass.dr4pl <- dr4pl(Response ~ Dose,
data = sample_data_1)
print(ryegrass.dr4pl)
obj.dr4pl <- dr4pl(Response ~ Dose, data = sample_data_5)
print(obj.dr4pl)
Print the dr4pl object summary to screen.
Description
Print the dr4pl object summary to screen.
Usage
## S3 method for class 'summary.dr4pl'
print(x, ...)
Arguments
x |
a dr4pl object to be summarized |
... |
all normally printable arguments |
Examples
library(drc) # Needed for the data set 'ryegras'
dr4pl.ryegrass <- dr4pl(rootl ~ conc, data = ryegrass)
print(summary(dr4pl.ryegrass))
dr4pl.7 <- dr4pl(Response ~ Dose, data = sample_data_7)
print(summary(dr4pl.7))
Objects exported from other packages
Description
These objects are imported from other packages. Follow the links below to see their documentation.
Compute dr4pl residuals.
Description
Compute dr4pl residuals.
Usage
## S3 method for class 'dr4pl'
residuals(object, parm = NULL, ...)
## S3 method for class 'dr4pl_param'
residuals(object, dose, response, ...)
Arguments
object |
A dr4pl or dr4pl_param object. |
parm |
parameters of the dr4pl object. Usually made with [dr4pl_theta] |
... |
dots for future extensions |
dose |
Dose values |
response |
Response values |
Value
Vector of residuals.
sample_data_1
Description
These are a handful of experimentally derived datasets from the wet-laboratory. These may or may not have numerical errors in other dose-response curve-packages, but definitly not using these methods.
Examples
a <- dr4pl(Response~Dose, data = sample_data_1)
plot(a)
sample_data_10
Description
These are a handful of experimentally derived datasets from the wet-laboratory. These may or may not have numerical errors in other dose-response curve-packages, but definitly not using these methods.
Examples
a <- dr4pl(Response~Dose, data = sample_data_10)
plot(a)
sample_data_11
Description
These are a handful of experimentally derived datasets from the wet-laboratory. These may or may not have numerical errors in other dose-response curve-packages, but definitly not using these methods.
Examples
a <- dr4pl(Response~Dose, data = sample_data_11)
plot(a)
sample_data_12
Description
These are a handful of experimentally derived datasets from the wet-laboratory. These may or may not have numerical errors in other dose-response curve-packages, but definitly not using these methods.
Examples
a <- dr4pl(Response~Dose, data = sample_data_12)
plot(a)
sample_data_13
Description
These are a handful of experimentally derived datasets from the wet-laboratory. These may or may not have numerical errors in other dose-response curve-packages, but definitly not using these methods.
Examples
a <- dr4pl(Response~Dose, data = sample_data_13)
plot(a)
sample_data_2
Description
These are a handful of experimentally derived datasets from the wet-laboratory. These may or may not have numerical errors in other dose-response curve-packages, but definitly not using these methods.
Examples
a <- dr4pl(Response~Dose, data = sample_data_2)
plot(a)
sample_data_3
Description
These are a handful of experimentally derived datasets from the wet-laboratory. These may or may not have numerical errors in other dose-response curve-packages, but definitly not using these methods.
Examples
a <- dr4pl(Response~Dose, data = sample_data_3)
plot(a)
sample_data_4
Description
These are a handful of experimentally derived datasets from the wet-laboratory. These may or may not have numerical errors in other dose-response curve-packages, but definitly not using these methods.
Examples
a <- dr4pl(Response~Dose, data = sample_data_4)
plot(a)
sample_data_5
Description
These are a handful of experimentally derived datasets from the wet-laboratory. These may or may not have numerical errors in other dose-response curve-packages, but definitly not using these methods.
Examples
a <- dr4pl(Response~Dose, data = sample_data_5)
plot(a)
sample_data_6
Description
These are a handful of experimentally derived datasets from the wet-laboratory. These may or may not have numerical errors in other dose-response curve-packages, but definitly not using these methods.
Examples
a <- dr4pl(Response~Dose, data = sample_data_6)
plot(a)
sample_data_7
Description
These are a handful of experimentally derived datasets from the wet-laboratory. These may or may not have numerical errors in other dose-response curve-packages, but definitly not using these methods.
Examples
a <- dr4pl(Response~Dose, data = sample_data_7)
plot(a)
sample_data_8
Description
These are a handful of experimentally derived datasets from the wet-laboratory. These may or may not have numerical errors in other dose-response curve-packages, but definitly not using these methods.
Examples
a <- dr4pl(Response~Dose, data = sample_data_8)
plot(a)
sample_data_9
Description
These are a handful of experimentally derived datasets from the wet-laboratory. These may or may not have numerical errors in other dose-response curve-packages, but definitly not using these methods.
Examples
a <- dr4pl(Response~Dose, data = sample_data_9)
plot(a)
summary
Description
Print the summary of a dr4pl object.
Usage
## S3 method for class 'dr4pl'
summary(object, parm = NULL, ...)
Arguments
object |
a dr4pl object to be summarized |
parm |
parameters of the dr4pl object. Usually made with [dr4pl_theta] |
... |
additional arguments to be passed to [calculate.dr4pl] |
Examples
obj.dr4pl <- dr4pl(Response ~ Dose, data = sample_data_5) # Fit a 4PL model to data
summary(obj.dr4pl)
obj.dr4pl <- dr4pl(Response ~ Dose, data = sample_data_6) # Fit a 4PL model to data
summary(obj.dr4pl)
Obtain the variance-covariance matrix of the parameter estimators of a 4PL model.
Description
This function obtains the variance-covariance matrix of the parameter estimators of a 4PL model. The variance-covariance matrix returned by this function can be used to compute the standard errors and confidence intervals for statistical inference.
Usage
## S3 method for class 'dr4pl'
vcov(object, parm = NULL, use.Hessian = T, ...)
## S3 method for class 'dr4pl_param'
vcov(object, dose, response, use.Hessian = T, ...)
Arguments
object |
An object of the dr4pl class. |
parm |
parameters of the dr4pl object. Usually made with [dr4pl_theta]. The class of this object determines in which space the covariance is calculated for theta_2. |
use.Hessian |
logical, if set to TRUE, the default, then the Hessian matrix scaled by 1/2 is used as an approximation to C.hat. Otherwise the First order Jacobian is used instead. |
... |
dots for future extensions |
dose |
dose levels |
response |
response values |
Details
This function obtains the variance-covariance matrix of the parameter estimators of a 4PL model. The Hessian matrix is used to obtain the second order approximation to the sum-of-squares loss function, and then the standard errors are computed as the square roots of the half of the Hessian matrix. Please refer to Subsection 5.2.2 of Seber and Wild (1989).
Value
The variance-covariance matrix of the parameter estimators of a 4PL model whose columns are in the order of the upper asymptote, IC50, slope and lower asymptote from left to right and whose rows are in the same order.
a covariance matrix. If the 'parm' argument is of the class 'dr4pl_log10', then the covariance of row/column 2 represents log10(theta_2). If theta is of 'dr4pl_theta', then the covariance of row/column 2 represents theta_2 in linear space.
References
Seber GAF, Wild CJ (1989). Nonlinear regression, Wiley Series in Probability and Mathematical Statistics: Probability and Mathematical Statistics. John Wiley \& Sons, Inc., New York. ISBN 0-471-61760-1, doi: 10.1002/0471725315, http://dx.doi.org.libproxy.lib.unc.edu/10.1002/0471725315.
Examples
obj.dr4pl <- dr4pl(Response ~ Dose, data = sample_data_1) # Fit a 4PL model to data
vcov(obj.dr4pl) # Variance-covariance matrix of the parameters
obj.dr4pl <- dr4pl(Response ~ Dose, data = sample_data_2) # Fit a 4PL model to data
vcov(obj.dr4pl) # Variance-covariance matrix of the parameters