| Title: | Models of Pearson Correlation Coefficient |
|---|---|
| Description: | Implements regression models to assess the effect of covariates on the Pearson correlation coefficient for both bivariate normal and bivariate binary responses. This package provides likelihood-based inference using Newton-Raphson estimation and bootstrap-based methods for significance testing, featuring built-in robust handling for numerical instabilities in extreme samples. |
| Authors: | Ze Lin, Bo Li, Jinyao Shen |
| Maintainer: | Ze Lin <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.1.0 |
| Built: | 2026-06-04 08:39:52 UTC |
| Source: | https://github.com/lonze-nb/regcorr |
Generate data from bivariate Bernoulli
genDataBB(numSample, p, betaTrue, eta1True, eta2True, link)genDataBB(numSample, p, betaTrue, eta1True, eta2True, link)
numSample |
Sample size. |
p |
Number of covariates. |
betaTrue |
True beta vector. |
eta1True |
True eta1 vector. |
eta2True |
True eta2 vector. |
link |
Link function indicator ("1" = logistic; "2" = tanh). |
A list containing X, Y, and rho.
Generate data from bivariate normal
genDataBN(numSample, p, betaTrue, eta1True, eta2True, link)genDataBN(numSample, p, betaTrue, eta1True, eta2True, link)
numSample |
Sample size. |
p |
Number of covariates. |
betaTrue |
True beta vector. |
eta1True |
True eta1 vector. |
eta2True |
True eta2 vector. |
link |
Link function indicator ("1" = logistic; "2" = tanh). |
A list containing X, Y, and rho.
Logistic function
logistic(x)logistic(x)
x |
A numeric vector. |
The calculated logistic probability.
Estimate beta for Bivariate Bernoulli responses using Newton Raphson
NRfitBivBernoulli(Y, X, beta0, link)NRfitBivBernoulli(Y, X, beta0, link)
Y |
n by 2 matrix, paired responses. |
X |
n by p matrix, covariate matrix including first column of ones. |
beta0 |
Initial estimate of beta. |
link |
Indicator of link function ("1" = logistic, "2" = tanh). |
A list containing betaCurrent, numIter, and restart.
Estimate beta for Bivariate Normal responses using Newton Raphson
NRfitBivNormal(Y, X, betaIni, link)NRfitBivNormal(Y, X, betaIni, link)
Y |
n by 2 matrix, paired responses. |
X |
n by p matrix, covariate matrix including first column of ones. |
betaIni |
Initial estimate of beta. |
link |
Indicator of link function ("1" = logistic, "2" = tanh). |
A list containing betaCurrent, numIter, and restart.
Generate bivariate binary data
rbinary(n, p, rho)rbinary(n, p, rho)
n |
Number of rows. |
p |
1 by 2 mean vector of bivariate variables. |
rho |
Correlation of bivariate variables. |
n by 2 matrix of generated binary variables.
Subroutine to test the significance of individual parameters
subRoutineTest( numSample, p, link, model, betaTrue, betaIni, eta1True, eta2True, numSimu, numBoot )subRoutineTest( numSample, p, link, model, betaTrue, betaIni, eta1True, eta2True, numSimu, numBoot )
numSample |
Sample size. |
p |
Number of covariates. |
link |
Link function. |
model |
Model type (1: biv normal; 2: biv Bernoulli). |
betaTrue |
True beta. |
betaIni |
Initial beta. |
eta1True |
True eta1. |
eta2True |
True eta2. |
numSimu |
Number of simulations. |
numBoot |
Number of bootstrap iterations. |
A list containing RMSE, ConsistRate, and testing power.