Learn R Programming

investr (version 1.1.0)

invest: Calibration for Linear and Nonlinear Regression Models.

Description

The function invest computes the inverse estimate and a condfidence interval for the unknown predictor value that corresponds to an observed value of the response (or vector thereof) or specified value of the mean response. See the references listed below for more details.

Usage

invest(object, ...)

## S3 method for class 'lm': invest(object, y0, interval = c("inversion", "Wald", "none"), level = 0.95, mean.response = FALSE, lower, upper, tol = .Machine$double.eps^0.25, maxiter = 1000, adjust = c("none", "Bonferroni"), k, ...)

## S3 method for class 'nls': invest(object, y0, interval = c("inversion", "Wald", "none"), level = 0.95, mean.response = FALSE, lower, upper, tol = .Machine$double.eps^0.25, maxiter = 1000, adjust = c("none", "Bonferroni"), k, ...)

## S3 method for class 'lme': invest(object, y0, interval = c("inversion", "Wald", "none"), level = 0.95, mean.response = FALSE, lower, upper, q1, q2, tol = .Machine$double.eps^0.25, maxiter = 1000, ...)

Arguments

object
An object that inherits from class lm or nls.
y0
The value of the observed response(s) or specified value of the mean response.
interval
The type of interval required.
level
A numeric scalar between 0 and 1 giving the confidence level for the interval to be calculated.
mean.response
Logical indicating whether confidence intervals should correspond to an individual response (FALSE) or a mean response (TRUE).
lower
The lower endpoint of the interval to be searched.
upper
The upper endpoint of the interval to be searched.
q1
Optional lower cutoff to be used in forming confidence intervals. Only used when object inherits from class lme. Defaults to qnorm((1+level)/2).
q2
Optional upper cutoff to be used in forming confidence intervals. Only used when object inherits from class lme. Defaults to qnorm((1-level)/2).
tol
The desired accuracy passed on to uniroot. Recommend a minimum of 1e-10.
maxiter
The maximum number of iterations passed on to uniroot.
adjust
A logical value indicating if an adjustment should be made to the critical value used in calculating the confidence interval. This is useful for when the calibration curve is to be used multiple, say k, times.
k
The number times the calibration curve is to be used for computing a confidence interval. Only needed when adjust = "Bonferroni".
...
Additional optional arguments. At present, no optional arguments are used.

Value

  • An object of class calibrate containing the following components: [object Object],[object Object],[object Object],[object Object],[object Object]

References

Graybill, F. A., and Iyer, H. K. Regression analysis: Concepts and Applications. Belmont, Calif: Duxbury Press, 1994.

Huet, S., Bouvier, A., Poursat, M-A., and Jolivet, E. Statistical Tools for Nonlinear Regression: A Practical Guide with S-PLUS and R Examples. New York: Springer, 2004.

Seber, G. A. F., and Wild, C. J.. Nonlinear regression. New York: Wiley, 1989.

Examples

Run this code
data(Puromycin, package = "datasets")
Puromycin2 <- Puromycin[Puromycin$state == "treated", ]
Puro2.nls <- nls(rate ~ (theta1 * conc) / (theta2 + conc),
                 data = Puromycin2, start = list(theta1 = 200, theta2 = 1))
plotFit(Puro2.nls, interval = "both")
invest(Puro2.nls, y0 = 100, interval = "inversion")
invest(Puro2.nls, y0 = 100, interval = "inversion", mean.response = TRUE)

Run the code above in your browser using DataLab