% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/makeErrorPoly.R
\name{makeErrorPoly}
\alias{makeErrorPoly}
\title{Assay error polynomial coefficients}
\usage{
makeErrorPoly(
  obs,
  sd,
  data,
  outeq = 1,
  col = "red",
  cex = 3,
  pch = "+",
  lcol = "blue",
  lwd = 2,
  ref = T,
  legend = T,
  ...
)
}
\arguments{
\item{obs}{A vector of observations}

\item{sd}{A vector of standard deviations obtained from repeated measurements at each
observation in \code{obs}}

\item{data}{A Pmetrics data file.  From this, the maximum and mininimum observations will be retrieved.
This is useful to ensure that calculated standard deviations are not negative
at any observation in the dataset.  If not specified, the default is the maximum \emph{obs}.}

\item{outeq}{The output equation in \emph{data}.  Default is 1.}

\item{col}{Color of the data points. Default is red.}

\item{cex}{Relative size of the data points.  Default is 3. See \code{\link{par}}.}

\item{pch}{Ploting symbol.  Default is \dQuote{+}.  See \code{\link{par}}.}

\item{lcol}{Color of the fitted polynomial lines.  Default is blue.}

\item{lwd}{Width of the lines. Default is 2.}

\item{ref}{Add a reference line at SD 0 to help evaluate that all fitted SDs are >0.  Default is true.}

\item{legend}{Boolean argument to plot legend.  Default is \code{TRUE}.}

\item{\dots}{Other plotting parameters as in \code{\link{plot.default}} and \code{\link{par}}}
}
\value{
A plot of the measured observations and fitted polynomial curves and a list with the
first, second, and third order coefficients
}
\description{
\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#stable}{\figure{lifecycle-stable.svg}{options: alt='[Stable]'}}}{\strong{[Stable]}}

Estimate coefficients for the polynomial to describe assay error.
}
\details{
This function plots first, second, and third order polynomial functions fitted
to pairs of observations and associated standard deviations for a given output assay.
In this way, the standard deviation associated with any observation may be calculated and
used to appropriately weight that observation in the model building process.  Observations
are weighted by the reciprocal of the variance, or squared standard deviation.
}
\examples{
makeErrorPoly(obs = c(0, 5, 50, 100, 250, 500, 1000), sd = c(1, 0.4, 4.5, 12, 34, 60, 190))
}
\author{
Michael Neely
}
