% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/pmm2_inference.R
\name{pmm2_inference}
\alias{pmm2_inference}
\title{Bootstrap inference for PMM2 fit}
\usage{
pmm2_inference(
  object,
  formula,
  data,
  B = 200,
  seed = NULL,
  parallel = FALSE,
  cores = NULL,
  ci_method = c("normal", "percentile", "basic")
)
}
\arguments{
\item{object}{object of class PMM2fit}

\item{formula}{the same formula that was used initially}

\item{data}{data frame that was used initially}

\item{B}{number of bootstrap replications}

\item{seed}{(optional) for reproducibility}

\item{parallel}{logical, whether to use parallel computing}

\item{cores}{number of cores to use for parallel computing, defaults to auto-detect}

\item{ci_method}{character: confidence-interval method.
\describe{
\item{"normal" (default)}{Symmetric Wald interval
\eqn{\hat\beta \pm z_{1-\alpha/2}\,\widehat{\mathrm{SE}}}
using the bootstrap standard deviation as
\eqn{\widehat{\mathrm{SE}}}. Always contains the point
estimate and is robust to mild finite-sample bias of the
bootstrap distribution.}
\item{"percentile"}{Empirical 2.5/97.5 percentiles of the
bootstrap re-estimates (Efron's original percentile method).
Not centred on the point estimate when the bootstrap
distribution is biased.}
\item{"basic"}{Davison & Hinkley (1997) basic/pivotal interval
\eqn{[2\hat\beta - q_{1-\alpha/2},\;2\hat\beta - q_{\alpha/2}]},
reflecting the percentile bracket about the point estimate.}
}
The returned object includes a \code{bias} column
(\eqn{\mathrm{mean}(\text{boot}) - \hat\beta}) so users can
detect finite-sample bias and switch CI methods if desired.}
}
\value{
data.frame with columns: Estimate, Std.Error, bias,
t.value, p.value, conf.low, conf.high.
}
\description{
Residual-bootstrap standard errors, p-values, and confidence
intervals for a PMM2 regression fit. Three CI methods are
available (see \code{ci_method}).
}
