Pearson's correlation coefficient is commonly used as a single-number summary of association between two responses. In many applications, however, the strength of association is itself heterogeneous and may vary with demographic, biological, experimental, or environmental covariates. The regcorr package implements regression models in which a Pearson correlation coefficient is linked to a linear predictor of covariates. The package supports bivariate normal responses and bivariate Bernoulli responses, provides Newton-Raphson estimation routines, includes data generators for simulation studies, and supplies a bootstrap-based subroutine for assessing the significance and power of covariate effects. The implementation follows the likelihood-based framework of Dufera, Liu, and Xu (2023) and exposes it through a lightweight R interface with no compiled code and minimal dependencies. This paper describes the statistical model, the computational design of regcorr, reproducible usage examples, and practical guidance for interpreting covariate-dependent correlations. The package is available from the Comprehensive R Archive Network at https://CRAN.R-project.org/package=regcorr under the MIT license.
翻译:皮尔逊相关系数通常用作两个响应变量间关联强度的单数值概括。然而在许多应用中,关联强度本身具有异质性,可能随人口学、生物学、实验或环境协变量而改变。regcorr包实现了将皮尔逊相关系数与协变量线性预测因子相关联的回归模型。该包支持二元正态响应和二元伯努利响应,提供牛顿-拉夫森估计程序,包含用于模拟研究的数据生成器,并提供了基于自助法的子程序来评估协变量效应的显著性与统计检验效能。其实现遵循Dufera、Liu和Xu(2023)的似然框架,通过轻量级R接口暴露功能,无需编译代码且依赖项极少。本文描述了统计模型、regcorr的计算设计、可复现的使用示例,以及解释协变量依赖性相关系数的实用指南。该包以MIT许可协议发布于综合R档案网络,网址为https://CRAN.R-project.org/package=regcorr。