Learn R Programming

tcplfit2 (version 0.1.7)

fitcnst: Constant Model Fit

Description

Function that fits a constant line \(f(x) = 0\) and returns generic model outputs.

Usage

fitcnst(conc, resp, nofit = FALSE, errfun = "dt4", ...)

Value

List of five elements: success, aic (Akaike Information Criteria), rme (root mean square error), er (error parameter), pars (parameter names).

Arguments

conc

Vector of concentration values NOT in log units.

resp

Vector of corresponding responses.

nofit

If nofit = TRUE, returns formatted output filled with missing values.

errfun

Which error distribution to assume for each point, defaults to "dt4". "dt4" is the original 4 degrees of freedom t-distribution. Another supported distribution is "dnorm", the normal distribution.

...

Space for parameters so fitcnst can be called similar to other fitting functions (currently unused)

Details

success = 1 for a successful fit, 0 if optimization failed, and NA if nofit = TRUE. aic, rme, and er are set to NA in case of nofit or failure. pars always equals "er".

Examples

Run this code
fitcnst(c(.1,1,10,100), c(1,2,0,-1))
fitcnst(c(.1,1,10,100), c(1,2,0,-1), nofit = TRUE)

Run the code above in your browser using DataLab