Package 'BWMR'

Title: Bayesian Weighted Mendelian Randomization (BWMR)
Description: Inference the causality based on BWMR method.
Authors: Jia Zhao
Maintainer: The package maintainer <[email protected]>
License: GPL (>= 3)
Version: 0.1.1
Built: 2024-11-09 04:22:38 UTC
Source: https://github.com/remlapmot/BWMR

Help Index


Inference the causality based on BWMR method

Description

Estimate the causal effect between the exposure and the outcome.

Usage

BWMR(gammahat, Gammahat, sigmaX, sigmaY, alpha = 100, sqsigma0 = (1e6)^2)

Arguments

gammahat

SNP-exposure effects.

Gammahat

SNP-outcome effects.

sigmaX

Standard errors of SNP-exposure effects.

sigmaY

Standard errors of SNP-outcome effects.

alpha

Value of alpha.

sqsigma0

Value of sqsigma0.

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)

  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

Example Mendelian randomization genotype summary level dataset

Description

An example Mendelian randomization dataset.

Usage

ExampleData

Format

who

A data frame with 76 rows and 5 columns:

SNP

SNP genotype

beta.exposure

SNP-exposure estimates

beta.outcome

SNP-outcome estimates

se.exposure

Standard errors of the SNP-exposure estimates

se.outcome

Standard errors of the SNP-outcome estimates