Learn R Programming

drLumi (version 0.1.2)

conf_bands: Confidence interval for a scluminex object

Description

Computes confidence or prediction interval for the response variable given a concentration value.

Usage

conf_bands(x, analyte = NULL, xvalue, level = 0.95, interval = "confidence")

Arguments

x
a scluminex object.
analyte
character vector specifying the analytes to estimate the interval. Default NULL (all analytes).
xvalue
vector of numeric values of the concentration.
level
numeric value for interval confidence or prediction level. Default 0.95.
interval
character defining type of interval, either 'confidence' or 'prediction'. Default 'confidence'.

Value

A data.frame with predicted response, lower and upper confidence (prediction) limits, standard error, concentration value, analyte, interval method and background method.

Details

Two types of interval can be estimated 'prediction' interval and 'confidence' interval. If the did not converge the function returns NA for all xvalue. If the function cannot estimate the value NaN is returned.

References

Ruckstuhl, A. (2010). Introduction to Nonlinear Regression. http://stat.ethz.ch/~stahel/courses/cheming/nlreg10E.pdf

See Also

predict.nls

Examples

Run this code
# Load data and fit models
data(ecdata)
data(mfidata)

plate1 <- mfidata[mfidata$plate=="plate_1",]
datasets <- data_selection(plate1, ecfile = ecdata)

background <- datasets[[1]]$background
standard <- datasets[[1]]$standard
mod <- scluminex(plateid = "plate_1", standard = standard,
background = background, bkg = "ignore",lfct="SSl4",
fmfi = "mfi", verbose = FALSE)

# Confidence-prediction intervals for FGF analyte
conf_bands(mod, "FGF", xvalue = c(1,3,4), interval = "confidence")
conf_bands(mod, "FGF", xvalue = c(1,3,4), interval = "prediction")

# For all analytes the prediction interval
conf_bands(mod, xvalue = 0.5, interval = "prediction")

Run the code above in your browser using DataLab