The hardware and bandwidth for this mirror is donated by METANET, the Webhosting and Full Service-Cloud Provider.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]metanet.ch.

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

✨ Key Features

📥 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.

These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.