MR_MtRobin_resample: Obtain p-value from MR-MtRobin results

Description Usage Arguments Value Examples

View source: R/main.R

Description

Uses a resampling procedure to estimate a P-value for a MR-MtRobin object.

Usage

1
2
MR_MtRobin_resample(MR_MtRobin_res, nsamp = 10000,
  use_nonconverge = FALSE)

Arguments

MR_MtRobin_res

a list object returned by MR_MtRobin.

nsamp

integer of the number of samples to use in estimating P-value using a null distribution.

use_nonconverge

logical of whether to use samples resulting in non-convergence of random slope

Value

A list of two elements:

pvalue numeric of the estimated P-value.
nsamp_used integer of the number of samples used in estimating the P-value.

nsamp_used is returned because not all nsamp may be used if use_nonconverge=FALSE (samples will be dropped if the model does not converge or results in a singular fit of the random slope).

Examples

1
2
3
myRes <- MR_MtRobin(snpID,gwas_betas,gwas_se,eqtl_betas,eqtl_se,eqtl_pvals,LD)

MR_MtRobin_resample(MR_MtRobin_res=myRes, nsamp=1e4, use_nonconverge=FALSE)

kjgleason/Mr.MtRobin documentation built on Sept. 6, 2021, 5:13 p.m.