pool_cor: Calculates the pooled correlation coefficient and Confidence...

View source: R/pool_cor.R

pool_corR Documentation

Calculates the pooled correlation coefficient and Confidence intervals

Description

pool_cor Calculates the pooled correlation coefficient and Confidence intervals.

Usage

pool_cor(
  data,
  conf.level = 0.95,
  dfcom = NULL,
  statistic = TRUE,
  df_small = TRUE,
  approxim = "tdistr"
)

Arguments

data

An object of class 'mistats' ('Multiply Imputed Statistical Analysis'.) or a m x 2 matrix with C-index values and standard errors in the first and second column. For the latter option dfcom has to be provided.

conf.level

conf.level Confidence level of the confidence intervals.

dfcom

Number of completed-data analysis degrees of freedom. Default number is taken from function cindex

statistic

if TRUE (default) the test statistic and p-value are provided, if FALSE these are not shown. See details.

df_small

if TRUE (default) the (Barnard & Rubin) small sample correction for the degrees of freedom is applied, if FALSE the old number of degrees of freedom is calculated.

approxim

if "tdistr" a t-distribution is used (default), if "zdistr" a z-distribution is used to derive a p-value for the test statistic.

Details

Rubin's Rules are used for pooling. The correlation coefficient is first transformed using Fisher z transformation (function cor2fz) before pooling and finally back transformed (function fz2cor). The test statistic and p-values are obtained using the Fisher z transformation.

Value

An object of class mipool from which the following objects can be extracted:

  • cor correlation coefficient

  • SE standard error

  • t t-value (for confidence interval)

  • low_r lower limit of confidence interval

  • high_r upper limit of confidence interval

  • statistic test statistic

  • pval p-value

Author(s)

Martijn Heymans, 2022

See Also

with.milist, cor_est

Examples


 imp_dat <- df2milist(lbpmilr, impvar="Impnr")
 res_stats <- with(data=imp_dat,
  expr = cor_est(y=BMI, x=Age))
 res <- pool_cor(res_stats)
 res


miceafter documentation built on Oct. 2, 2022, 5:08 p.m.