Description Usage Arguments Details Value Author(s) See Also Examples

This function fits either a 4-PL or 5-PL sigmoidal model (classic logistic model and the
Hill's form) to the data from a immunoassay run - nominally an object of class
`"ima"`

. The user can select the model type, several types of weighting,
which calibrators to use and even the starting values for the `nls`

fit. This
function can also automatically select best fit from user selected list, and it can
remove erroneous calibration points (only one replicate) automatically to improve the fit.

1 2 |

`x` |
An object of class |

`analyte` |
Numeric. Selects the analyte for which the fit is desired - from the analytes available in the data |

`model` |
Character vector, can be any combination of the following values: "L.4", "L.5",
"H.4" and "H.5", or alternatively it can have the value |

`weights` |
Character or Numeric vector. If |

`refit` |
Numeric. If automatic selection of calibrator replicates is desired, this is the threshold
for the in-accuracy error of the standard. If the post-hoc estimated value for any of the
replicates has error above the given threshold, the function will attempt to re-fit the
model without this replicate and check if this improves the fit. This can be suppressed
by providing value of |

`use` |
A numeric vector of length one, or the exact same length as the number of calibrator
replicates. It is to be composed of "0"s and "1"s and can be used to arbitrarily select
calibrator replicates to use for fitting. Use the value of |

`stvals` |
Character or a list. It can have the following values: NULL - tells the function to use
the default starting values for the |

`sledz` |
Logical. This turns on internal debugging for use by the developer only. Defaults to FALSE. |

The `sigfit`

function is the actual work horse of the whole `immunoassay`

library.
It does the fitting of sigmoidal models by using the `nls`

function. Four models
are hard-coded in it to choose from: two 4-PL and two 5-PL models, each can be either
in the form of standard sigmoidal equation (logistic function), or in the logarithm (Hill's)
form.

The user can either select the model and all its parameters explicitly, or can provide
vectors of parameters for the function to choose from. The function will fit the models
for all combinations of parameters and will select the best-fit model based on the
criteria of residual standard error and R-squared. The user can also set the model and
weighting parameters to `"auto"`

and leave the decision on selecting the model
entirely in the hands of the algorithm in this function.

The function can attempt to recognize and remove single replicates of standards that
cross the threshold of in-accuracy (`refit`

parameter). Of note: once the threshold is
crossed by at least one replicate, the function will go through all replicates in the
sequence of decreasing error (in-accuracy) and attempt to re-fit the model without
them. This may sometimes result in more than one replicate removed (but always only
one replicate per standard), even if only one replicate was above the threshold in the
beginning. The criteria to "keep the replicate out" is currently that the overall
error of the old model must be more than `1+refit`

times the error for the
re-fit model. Additionally, the QC criteria are checked: whether the QC predictions
for the re-fit model are within the limits - if they were within those limits for the
old model. If not, the removed standard is re-introduced - this is to prevent situations
where automatic removing of calibrators would improve the fit but mess up the QCs.

In situations where the user is certain that some standards must be excluded from fitting,
it can be done using the `use`

parameter - simply put "0"s for the replicates to
be removed.

If the model convergence fails with the default `nls`

starting values, that are
hard-coded, users are encouraged to experiment with the `"stvals"`

. The starting
values can be provided directly as a list, or the option `"adaptive"`

can be used
as well. For the `"adaptive"`

starting values to work, a global list named
`"immunoassay.coefs"`

must be present and appropriately formatted. This list can be
created manually, though the function `batch`

creates it automatically if
it does not exist.

Function `sigfit`

returns an object of class `"sigfit"`

, that is a list
composed of the following items:

`fit ` |
The actual |

`data ` |
The |

`qcs ` |
Similarly, a |

`model ` |
Character vector of the final model information, describing the model type and weighting type. |

`analyte ` |
Character vector of analyte information: first, analyte names, then units. |

`file ` |
Character, the name of the raw data file, for which the fit was done. |

`stats ` |
A matrix of summary statistics of the models, if more than one model or weighting type was provided as an input. |

Michal J. Figurski, PhD mfigrs@gmail.com of the Biomarker Research Laboratory, University of Pennsylvania, Philadelphia, PA.

`immunoassay package`

, `batch function`

and
`plot.sigfit`

.

1 2 3 4 5 6 7 8 | ```
## Not run:
run = read.multiplex("your-path-here")
fit = sigfit(run)
fit
summary(fit)
plot(fit)
## End(Not run)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.