% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/pci.R
\name{pci}
\alias{pci}
\title{Compute a Process Capability Index}
\usage{
pci(
  index,
  dist = NULL,
  LSL = NULL,
  USL = NULL,
  target = NULL,
  mu = NULL,
  sigma = NULL,
  xbar = NULL,
  s = NULL,
  LDL = NULL,
  UDL = NULL,
  p0 = NULL
)
}
\arguments{
\item{index}{Character string: one of \code{"Cp"}, \code{"Cpk"},
\code{"Cpu"}, \code{"Cpl"}, \code{"Cpm"}, \code{"Cpmk"},
\code{"Pp"}, \code{"Ppk"}, \code{"Ppu"}, \code{"Ppl"},
\code{"Z"}, or \code{"Cpy"}.}

\item{dist}{A \code{\link{pci_dist}} object (required for \code{"Cpy"};
optional otherwise).}

\item{LSL, USL}{Lower and upper specification limits.}

\item{target}{Target value (required for \code{Cpm} and \code{Cpmk}).}

\item{mu, sigma}{Short-term (within-subgroup) mean and standard deviation.}

\item{xbar, s}{Long-term (overall) mean and standard deviation.}

\item{LDL, UDL}{Lower and upper desirable limits for \code{Cpy}.}

\item{p0}{Desired yield for \code{Cpy}. If \code{LDL}/\code{UDL} are not
supplied, they are computed from \code{p0} using
\code{\link{compute_desirable_limits}}.}
}
\value{
A single numeric value, or \code{NA} with a warning when a
  one-sided index is requested but the relevant specification limit is
  \code{NULL}.
}
\description{
Computes a single process capability or performance index from the supplied
parameters.
}
\details{
The twelve supported indices are:
\describe{
  \item{Cp}{\eqn{(USL - LSL) / (6\sigma)}}
  \item{Cpk}{\eqn{\min\bigl((USL-\mu)/(3\sigma),\;(\mu-LSL)/(3\sigma)\bigr)}}
  \item{Cpu}{\eqn{(USL - \mu) / (3\sigma)}}
  \item{Cpl}{\eqn{(\mu - LSL) / (3\sigma)}}
  \item{Cpm}{\eqn{(USL - LSL) / \bigl(6\sqrt{\sigma^2+(\mu-T)^2}\bigr)}}
  \item{Cpmk}{\eqn{\min\bigl((USL-\mu),\;(\mu-LSL)\bigr) /
        \bigl(3\sqrt{\sigma^2+(\mu-T)^2}\bigr)}}
  \item{Pp}{\eqn{(USL - LSL) / (6s)}}
  \item{Ppk}{\eqn{\min\bigl((USL-\bar x)/(3s),\;(\bar x-LSL)/(3s)\bigr)}}
  \item{Ppu}{\eqn{(USL - \bar x) / (3s)}}
  \item{Ppl}{\eqn{(\bar x - LSL) / (3s)}}
  \item{Z}{\eqn{\min\bigl((USL-\mu)/\sigma,\;(\mu-LSL)/\sigma\bigr)}}
  \item{Cpy}{\eqn{p / p_0 = \bigl(F(USL)-F(LSL)\bigr) /
        \bigl(F(UDL)-F(LDL)\bigr)}}
}
}
\examples{
pci("Cp",  LSL = 57, USL = 63, sigma = 1)            # 1.0
pci("Cpk", LSL = 57, USL = 63, mu = 60, sigma = 1)   # 1.0
pci("Z",   LSL = 57, USL = 63, mu = 60, sigma = 1)   # 3.0

# Generalized Cpy
d <- pci_dist_normal(60, 1)
pci("Cpy", dist = d, LSL = 57, USL = 63, LDL = 57, UDL = 63) # 1.0

}
\seealso{
\code{\link{pci_dist}}, \code{\link{pci_ci}}, \code{\link{pci_grid}}
}
