Learn R Programming

mixtox (version 1.0)

curveFit: Curve Fitting

Description

Six sigmoidal equations (Hill, Logit, Weibull, Box-Cox-Weibull (BCW), Box-Cox-Logit (BCL), Generalised Logit (GL)) are provided to fit the concentration-response data. The goodness of fit is evaluated by the following statistics: coefficient of determination ($R^2$), adjusted coefficient of determination ($R_{adj}^2$), root mean squared error (RMSE), mean absolute error (MAE), and Akaike information criterion (AIC).

Usage

curveFit(x, expr, eq = c("Hill", "Weibull", "Logit", "BCW", "BCL", "GL"), 
param, 	effv, sigLev = 0.05, noec = TRUE, fig = TRUE, algo = default)

Arguments

x
a numeric vector of experimental concentrations
expr
a numeric matrix with one or more columns. each column represents one experimental repetition.
eq
equations to be used: Hill, Weibull, Logit, BCW, BCL, GL.
param
starting values for the curve fitting. Two values for Hill, Weibull, Logit, and three values for BCW, BCL, GL.
effv
numeric vector with single or multiple effect values (0 ~ 1).
sigLev
The significant level for confidence intervals and Dunnett's test. The default is 0.05.
noec
a logical value (TRUE of FALSE). Whether to calculate NOEC and LOEC for the concentration-response data.
fig
a logical value (TRUE of FALSE). Whether to show the concentration-response curve.
algo
algorithm used in the non-linear least squares fitting. if package 'nls2' is installed on your R platform. The following choices are available : brute-force"(alternately called "grid-search"), "random-search", "plinear-brute" and "plinear-rand

Value

  • fitInfocurve fitting information including the formula used to fit the concentration- response data. The fitted coefficients with standard errors, t test value, and p value. Residual standard error and the degree of freedom are also provided.
  • pfitted coefficients of the formula
  • staStatistics about the goodness of fit ($R^2$, $R_{adj}^2$, MAE, RMSE, AIC)
  • crcInfoa numeric matrix with the experimental concentration (x), fitted response (yhat), experimental responses, lower and upper bounds of observation-based confidence intervals (OCI.low and OCI.up), and lower and upper bounds of function-based confidence intervals (FCI.low and FCI.up)
  • eciThe confidence intervals of effect concentration at the response of effv
  • effvciThe confidence intervals of the response effv
  • noecInfo$mata matrix of experimental concentrations, Student's t-statistic, F distribution at the sigLev,and sign (-1 or 1)
  • noecInfo$nonon-observed effect concentration (NOEC)
  • noecInfo$loleast-observed effect concentration (LOEC)

Details

The curve fitting is conditionally dependent on the package 'nls2'. It will decide whether to use the built-in nonlinear least squares fitting function nls or its robust counterpart 'nls2' (http://cran.r-project.org/web/packages/nls2/index.html). Six sigmoidal equations are as follows: Hill: $$E = \alpha c/\left( {\beta + c} \right)$$ Weibull: $$E = 1 - \exp ( - \exp (\alpha + \beta \lg (c)))$$ Logit: $$E = {(1 + \exp ( - \alpha - \beta \lg (c)))^{ - 1}}$$ BCW: $$E = 1 - \exp \left( { - \exp \left( {\alpha + \beta \left( {\frac{{{c^\gamma } - 1}}{\gamma }} \right)} \right)} \right)$$ BCL: $$E = {(1 + \exp ( - \alpha - \beta (({c^\gamma } - 1)/\gamma )))^{ - 1}}$$ GL: $$E = 1/{(1 + \exp ( - \alpha - \beta \lg (c)))^\gamma }$$ where $E$ is effect and $c$ is the concentration.

References

Scholze, M. et al. 2001. A General Best-Fit Method for Concentration-Response Curves and the Estimation of Low-Effect Concentrations. Environmental Toxicology and Chemistry 20(2):448-457. Spiess, A.-N., Neumeyer, N., 2010. An evaluation of R2 as an inadequate measure for nonlinear models in pharmacological and biochemical research: A Monte Carlo approach. BMC Pharmacol. 10, 11. Gryze, S. De, Langhans, I., Vandebroek, M., 2007. Using the correct intervals for prediction: A tutorial on tolerance intervals for ordinary least-squares regression. Chemom. Intell. Lab. Syst. 87, 147-154.

Examples

Run this code
data(cytotox)
## example 1
# Fit the concentration-response data of heavy metal Ni(2+) on MCF-7 cells
# Logit equation is selected as the fitting function with a starting value of 12 and 3.
x <- cytotox$Ni$x
expr <- cytotox$Ni$y
curveFit(x, expr, eq = 'Logit', param = c(12, 3), effv = 0.5)

## example 2
# Fit the concentration-response data of heavy metal Ni(2+) on MCF-7 cells. 
# Calculate the concentrations that cause 5\% and 50\% inhibition of the growth of MCF-7 and
# corresponding confidence intervals.
x <- cytotox$Ni$x
expr <- cytotox$Ni$y
curveFit(x, expr, eq = 'Logit', param = c(12, 3), effv = c(0.05, 0.5))

## example 3
# Fit the concentration-response data of ion liquid Omim on MCF-7 cells
# Weibull equation is selected as the fitting function with a starting value of 6 and 2.
# Calculate the concentrations that cause 5\% and 50\% inhibition of the growth of MCF-7 and
# corresponding confidence intervals.
x <- cytotox$Omim$x
expr <- cytotox$Omim$y
curveFit(x, expr, eq = 'Weibull', param = c(6, 2), effv = c(0.05, 0.5))

Run the code above in your browser using DataLab