% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/pci_ci.R
\name{pci_ci}
\alias{pci_ci}
\title{Bootstrap Confidence Interval for a Process Capability Index}
\usage{
pci_ci(
  index,
  dist,
  n,
  data = NULL,
  LSL = NULL,
  USL = NULL,
  target = NULL,
  LDL = NULL,
  UDL = NULL,
  p0 = NULL,
  alpha = 0.05,
  B = 2000,
  method = c("percentile", "bca")
)
}
\arguments{
\item{index}{Character: one of the 12 index names (see \code{\link{pci}}).}

\item{dist}{A \code{\link{pci_dist}} object.}

\item{n}{Integer sample size.}

\item{data}{Optional numeric vector of observed data. If supplied,
nonparametric bootstrap is used instead of parametric.}

\item{LSL, USL}{Specification limits.}

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

\item{LDL, UDL}{Desirable limits (for \code{Cpy}).}

\item{p0}{Desired yield (for \code{Cpy}).}

\item{alpha}{Significance level; the interval covers \eqn{1 - \alpha}.
Default 0.05.}

\item{B}{Number of bootstrap replications. Default 2000.}

\item{method}{Character: \code{"percentile"} (default) or \code{"bca"}.}
}
\value{
An S3 object of class \code{"pci_ci"} with components:
  \item{index}{The index name.}
  \item{estimate}{Point estimate.}
  \item{lower}{Lower CI bound.}
  \item{upper}{Upper CI bound.}
  \item{alpha}{The significance level used.}
  \item{method}{The interval method used.}
  \item{boot_values}{Numeric vector of all \code{B} bootstrap estimates.}
}
\description{
Computes a confidence interval for a PCI via parametric or nonparametric
bootstrap.
}
\details{
**Parametric bootstrap** (when \code{data = NULL}): \code{B} samples of size
\code{n} are drawn from \code{dist} via inverse-CDF sampling.
For each sample the process mean, standard deviation (and, for
\eqn{C_{py}}, the empirical CDF) are estimated, and the index is
recomputed.

**Nonparametric bootstrap** (when \code{data} is supplied): \code{B}
resamples of the same length are drawn with replacement from \code{data}.

Two interval methods are available:
\describe{
  \item{percentile}{Uses the \code{alpha/2} and \code{1 - alpha/2}
    quantiles of the bootstrap distribution.}
  \item{bca}{Bias-corrected and accelerated interval using jackknife
    acceleration and bootstrap bias correction (Efron, 1987).}
}
}
\examples{
d <- pci_dist_normal(mean = 60, sd = 1)
ci <- pci_ci("Cp", dist = d, n = 30, LSL = 57, USL = 63,
             alpha = 0.05, B = 500)
print(ci)

}
\seealso{
\code{\link{pci}}, \code{\link{pci_grid}}
}
