Fit Standards
fitStd.Rd
Fit a specified function to standards (serial dilutions). Optionally an interactive procedure that allows to remove outliers, evaluate resulting fits, perform revisions, and record a message regarding the fit.
Usage
fitStd(
std,
xvar,
yvar,
model = "sigmoid",
Alow = NULL,
asym = TRUE,
interactive = TRUE,
monot.prompt = FALSE,
rm.before = FALSE,
rm.after = interactive,
maxrm = 2,
set.bounds = FALSE,
overwrite.bounds = FALSE,
bg = NULL,
vsmp = NULL,
optmethod = "Nelder-Mead",
maxit = 5000,
extrapolate.low = FALSE,
extrapolate.up = FALSE,
info = "",
ifix = NULL,
tcklab = NULL,
stdcol = c("firebrick3", "darkslategray"),
rugcol = c("cadetblue", "purple", "firebrick2"),
...
)
Arguments
- std
matrix or data frame with standards for fitting.
- xvar, yvar
character strings for the variables used to fit a standard curve. If
NULL
, first two columns are assumed to bex
andy
variables.- model
the model to be fit.
- Alow
lower asymptote for the sigmoid model. If
NULL
, the lower asymptote will be estimated, adding an extra parameter to the model. To fix the asymptote at the level of background, specify"bg"
. Numeric value ofAlow
will force the asymptote to be fixed at the provided level.- asym
if
TRUE
, asymmetry in the fit is allowed, adding an extra parameter to the model.- interactive
logical value. If
TRUE
, the user is prompted to evaluate the standards (and/or the fit) and asked to remove outliers if needed.TRUE
value takes precedence overrm.before
andrm.after
: if both areFALSE
,rm.after
is reset toTRUE
.- monot.prompt
if
TRUE
, the user is prompted to evaluate the standards and possibly remove outliers if the standards are not monotonic (increasing).FALSE
value is ignored ifinteractive
isTRUE
.- rm.before
logical value indicating if potential outliers should be removed before the model is fitted. Ignored if
interactive
isFALSE
.- rm.after
logical value indicating if potential outliers should be removed after the model is fitted. Ignored if
interactive
isFALSE
.- maxrm
maximum number of outliers to remove.
- set.bounds
if
TRUE
, the user is given the option to manually set the bound that is not set automatically. In that case, the prompt appears even ifinteractive
isFALSE
.- overwrite.bounds
logical value indicating the option to overwrite automatically set bounds. Ignored if
interactive
isFALSE
.- bg
values for background spots.
- vsmp
sample values.
- optmethod
method to be used in optimization.
- maxit
maximum number of iterations in optimization.
- extrapolate.low
if
TRUE
, sample values beyond lower bounds will be processed by extrapolation of the standard curve (not recommended). Takes precedence overtrim.flat
value.- extrapolate.up
if
TRUE
, sample values beyond upper bounds will be processed by extrapolation of the standard curve (not recommended). Takes precedence overtrim.flat
value.- info
information about a particular run for warning messages.
- ifix
sorted integer vector of length 3 with indices of standards to be used for getting starting values for optimization.
- tcklab
tick labels for x-axis.
- stdcol
vector of two colors for the standard points and the fit on the plot.
- rugcol
vector of three colors for the rugplot, which indicates sample values (inside the bounds, between the bounds and extrema, and beyond extrema).
- ...
further graphical parameters.