mixIE_multiple_start: mixIE_multiple_start

View source: R/mixIE_MA.R

mixIE_multiple_startR Documentation

mixIE_multiple_start

Description

Perform CEM algorithm with multiple starting values

Usage

mixIE_multiple_start(
  b_exp,
  b_out,
  se_exp,
  se_out,
  n,
  initial_theta_n = 50,
  initial_r = 0,
  initial_c = 1,
  initial_p = 0.2,
  flip = 1,
  EM_start = T,
  EM_maxit = 2,
  maxit = 200,
  ivw = T,
  egger = T,
  lb.theta = NULL,
  ub.theta = NULL
)

Arguments

b_exp

A vector of SNP effects on the exposure variable, usually obtained from a GWAS.

b_out

A vector of SNP effects on the outcome variable, usually obtained from a GWAS.

se_exp

A vector of standard errors of b_exp.

se_out

A vector of standard errors of b_out.

n

Sample size of either one of the GWAS dataset.

initial_theta_n

Number of different thetas generated, default is 50.

initial_r

Initial value of r, the averaged pleiotropic effect, default is 0.

initial_c

Initial value of c, the overdispersion parameter for invalid IVs, default is 1.

initial_p

Initial value of the proportion of invalid IVs, default is 0.2.

flip

Whether to reorient the SNPs like Egger regression?

EM_start

Whether to use EM algorithm to start the CEM? Default is TRUE.

EM_maxit

Number of iterations used in EM algorithm to start the CEM, default is 2.

maxit

Maximum number of iterations for each optimization, default is 200.

ivw

Whether to add the fixed effect IVW in the model candidates explictly? Default is TRUE.

egger

Whether to add the Egger regression in the model candidates explictly? Default is TRUE.

lb.theta

Lower bound of theta from which starting values are generated.

ub.theta

Upper bound of theta from which starting values are generated.

Value

A list

theta

A vector of estimated causal effect for different starting values ordered by BIC

se

A vector of corresponding standard error of theta

pval

A vector of corresponding two-sided p-value of theta

c

A vector of estimated overdispersion parameter for different starting values ordered by BIC

r

A vector of estimated pleiotropic effect for different starting values ordered by BIC

ser

A vector of corresponding standard error of r

p

A vector of estimated proportion of invalid IVs for different starting values ordered by BIC

BIC

A vector of BIC for different starting values sorting increasingly

niter

A vector of number of iterations for different starting values ordered by BIC

tau_1_mat

A matrix of posterior probabilities of each IVs being invalid for different starting values ordered by BIC


ZhaotongL/mixIE documentation built on April 14, 2023, 4:20 p.m.