% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/corrCI_sa.R
\name{corrCI_sa}
\alias{corrCI_sa}
\title{Stochastic Approximation Confidence Interval for Correlation}
\usage{
corrCI_sa(x, y, conf.level = 0.95)
}
\arguments{
\item{x}{Numeric vector of first variable (must have same length as y)}

\item{y}{Numeric vector of second variable (must have same length as x)}

\item{conf.level}{Confidence level for the interval (default 0.95)}
}
\value{
An S3 object of class "corrCI_sa" containing:
  \item{lower}{Lower bound of the confidence interval}
  \item{upper}{Upper bound of the confidence interval}
  \item{estimate}{Point estimate of correlation coefficient}
  \item{conf.level}{The confidence level}
  \item{method}{Description of the method}
  \item{iterations}{List with components L (iterations for lower bound) and U (iterations for upper bound)}
}
\description{
Computes confidence interval for the correlation of two populations
using stochastic approximation via resampling method (Garthwaite, 1996).
}
\details{
This function implements the stochastic approximation algorithm for constructing
nonparametric confidence intervals for Pearson's correlation coefficient,
based on Garthwaite (1996). The algorithm uses recursive resampling to find
the quantiles of the sampling distribution.
}
\examples{
set.seed(42)
x <- rnorm(30)
y <- x + rnorm(30, sd = 0.5)
result <- corrCI_sa(x, y)
print(result)

}
\references{
Garthwaite, P. H. (1996). Confidence interval formation via stochastic approximation.
Statistics and Computing, 6(3), 235-241.
}
