BWMR: Inference the causality based on BWMR method

View source: R/BWMR.R

BWMRR Documentation

Inference the causality based on BWMR method

Description

Estimate the causal effect between the exposure and the outcome.

Usage

BWMR(gammahat, Gammahat, sigmaX, sigmaY)

Arguments

gammahat

SNP-exposure effects.

Gammahat

SNP-outcome effects.

sigmaX

Standard errors of SNP-exposure effects.

sigmaY

Standard errors of SNP-outcome effects.

Details

BWMR obtain the causal effect based on summary statistics.

Value

mu_beta

Estimate of parameter beta.

se_beta

Estimate of the standard error of parameter beta.

P_value

P_value.

plot1

Plot of Data with Standard Error Bar.

plot2

Trace Plot of Logarithm of Approximate Data Likelihood.

plot3

Estimate of Weight of Each Data Point.

plot4

Plot of Weighted Data and Its Regression Result.

Author(s)

Jia Zhao

Examples

  library(BWMR)
  library(ggplot2)

  data(ExampleData)

  MRres <- BWMR(ExampleData$beta.exposure, ExampleData$beta.outcome, ExampleData$se.exposure, ExampleData$se.outcome)

  beta.hat <- MRres$beta
  beta.se <- MRres$se_beta
  P_value <- MRres$P_value

  # Plot1: Plot of Data with Standard Error Bar
  plot1 <- MRres$plot1
  plot1

  # Plot2: Trace Plot of Logarithm of Approximate Data Likelihood
  plot2 <- MRres$plot2
  plot2

  # Plot3: Estimate of Weight of Each Data Point
  plot3 <- MRres$plot3
  plot3

  # Plot4: Plot of Weighted Data and Its Regression Result
  plot4 <- MRres$plot4
  plot4

jiazhao97/BWMR documentation built on July 3, 2023, 7:45 a.m.