allele: cross-validated Allele score method.

Description Usage Arguments Value Examples

View source: R/CIVMR_function.R

Description

This function implement Allele score methods with cross-validation in the way Stephen Burgess suggested in the Allele score methods paper.

Usage

1
allele(MR.data, n_folds = 10)

Arguments

MR.data:

data frame containing G,X,Z,Y.

n_folds:

the number of folds for cross-validation.

Value

weights: the weights for allele score across folds. Each row is a weight vector corresponding to a specific fold.

allele_score: The cross-validated Allele score, which would be used as the new instruments in MR analysis.

beta_est: the causal effect estimation of β.

Examples

1
2
data(simulation)
allele.score <- allele(simulation,n_folds=10)

LaiJiang/CIVMR documentation built on July 16, 2020, 12:45 a.m.