BWMR: Inference the causality based on BWMR method

Description Usage Arguments Details Value Author(s) Examples

View source: R/BWMR.R

Description

Estimate the causal effect between the exposure and the outcome.

Usage

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
  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 Nov. 6, 2019, 1:43 p.m.