Learn R Programming

ebdm (version 3.0.0)

cor_cont: Estimate the Bivariate Normal Distribution from Marginal Summaries

Description

Estimate the correlation coefficient \(\rho\) (and marginal means / SDs) of two normally-distributed variables using summary-level data from multiple independent studies.

Usage

cor_cont(
  n,
  xbar,
  ybar,
  s2x = NULL,
  s2y = NULL,
  method = c("proposed", "weighted"),
  ci_method = c("none", "normal", "lr")
)

Value

A list with elements

  • mu_x, mu_y : estimated marginal means

  • sigma_x, sigma_y : estimated SDs

  • rho : estimated correlation

  • se : standard error of rho (proposed only)

  • ci : confidence interval for rho (if requested)

Arguments

n

Numeric vector. Sample size of each study.

xbar, ybar

Numeric vectors. Sample means of the two variables.

s2x, s2y

Numeric vectors. Sample variances; required for method = "proposed".

method

Character. "proposed" uses the proposed MLE method in the paper; "weighted" replicates the weighted mean based method (Baseline) when no variances are available.

ci_method

Confidence interval type: "none", "normal", or "lr" (likelihood ratio). Only implemented when method = "proposed".

Examples

Run this code
data(cont_example)
# Example with full summaries
cor_cont(cont_example$Sample_Size, cont_example$Mean_X, cont_example$Mean_Y,
 cont_example$Variance_X, cont_example$Variance_Y, method = "proposed", ci_method = "lr")

# Only means + n, weighted mean method
cor_cont(cont_example$Sample_Size, cont_example$Mean_X, cont_example$Mean_Y, method = "weighted")

Run the code above in your browser using DataLab