saCI: Stochastic Approximation Confidence Interval for Correlation

An R package implementing the stochastic approximation method for constructing nonparametric confidence intervals for Pearson’s correlation coefficient, based on Xiong & Xu (2016).

Installation

# Install from CRAN (once available)
install.packages("saCI")

# Or install development version from GitHub
# remotes::install_github("USERNAME/saCI")

Usage

library(saCI)

# Generate sample data
set.seed(42)
x <- rnorm(30)
y <- x + rnorm(30, sd = 0.5)

# Calculate confidence interval
result <- corrCI_sa(x, y)
print(result)

Features

Shiny App

Run the interactive Shiny app:

saCI::runShinyApp()
# or
shiny::runApp(system.file("shinyapp", package = "saCI"))

Method

This package implements the stochastic approximation algorithm for constructing confidence intervals without requiring large-scale resampling. The algorithm uses recursive Monte Carlo to find the quantiles of the sampling distribution.

References

License

GPL (>= 3)