MyNixOS website logo
Description

Regression Models of Pearson Correlation Coefficient.

Provides statistical tools for evaluating how covariates influence the strength of Pearson correlation coefficients between two response variables. Supports bivariate normal and bivariate binary responses, with likelihood-based inference and bootstrap-based significance testing. The methodology is based on Dufera, Liu and Xu (2023) "Regression models of Pearson correlation coefficient" <doi:10.1080/24754269.2023.2164970>.

regcorr: Regression Models of Pearson Correlation Coefficient

The regcorr R package provides statistical tools to evaluate how covariates of interest influence the strength of the Pearson correlation coefficient between two responses. It supports both continuous (bivariate normal) and bivariate binary (Bernoulli) responses without requiring repeated measures.

This package replicates and robustly extends the methodologies for likelihood-based inference using Newton-Raphson estimation and bootstrap-based significance testing.

👥 Authors

  • Ze Lin
  • Bo Li
  • Jinyao Shen

✨ Key Features

  • Bivariate Normal Responses: Models the Fisher z-transformed correlation (hyperbolic tangent link) against linear combinations of covariates.
  • Bivariate Binary Responses: Models the correlation of dichotomous outcomes using a logistic link function.
  • Algorithmic Robustness: Implements short-circuit evaluation and try-catch mechanisms to handle the notorious "perfect separation" and numerical instabilities (e.g., Hessian matrix explosion, NA/NaN generation) inherent in small-sample bivariate Bernoulli distributions.

📥 Installation

You can install the development version of regcorr directly from GitHub:

# Install devtools if you haven't already
# install.packages("devtools")

devtools::install_github("lonze-nb/regcorr")

🚀 Quick Start (Usage)

Here is a basic example of generating bivariate normal data and fitting the correlation regression model:

library(regcorr)

# 1. Set true parameters for simulation
true_beta <- c(0.25, 1, 0) # Intercept and two covariates
true_eta <- c(0, 0, 0)

# 2. Generate simulated Bivariate Normal data (n = 500)
set.seed(123)
my_data <- genDataBN(numSample = 500, p = 2, 
                     betaTrue = true_beta, 
                     eta1True = true_eta, 
                     eta2True = true_eta, 
                     link = "1") # 1: logistic link, 2: tanh link

# 3. Fit the model using Newton-Raphson iteration
fit_result <- NRfitBivNormal(Y = my_data$Y, X = my_data$X, 
                             betaIni = c(0.25, 0, 0), 
                             link = "1")

# 4. View the estimated parameters and number of iterations
print(fit_result$betaCurrent)
print(fit_result$numIter)

📖 References

This package is built based on the statistical framework proposed in related literature regarding regression models of Pearson correlation coefficients.

Dufera, A. G., Liu, T., & Xu, J. (2023). Regression models of Pearson correlation coefficient. Statistical Theory and Related Fields, 7(2), 97-106.

Metadata

Version

0.1.0

License

Unknown

Platforms (79)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    uefi
    wasip1
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-uefi
  • aarch64-windows
  • aarch64_be-none
  • arc-linux
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-linux
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • sh4-linux
  • vc4-none
  • wasm32-wasip1
  • wasm64-wasip1
  • x86_64-cygwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-uefi
  • x86_64-windows