mr_cML: MRcML method

View source: R/mr_cML.R

mr_cMLR Documentation

MRcML method

Description

This is the main function of MRcML method, without data perturbation.

Usage

mr_cML(
  b_exp,
  b_out,
  se_exp,
  se_out,
  K_vec = 0:(length(b_exp) - 2),
  random_start = 0,
  maxit = 100,
  random_seed = 0,
  n
)

Arguments

b_exp

Vector of estimated effects for exposure.

b_out

Vector or estimated effects for outcome.

se_exp

Vector of standard errors for exposure.

se_out

Vector of standard errors for outcome.

K_vec

Sets of candidate K's, the constraint parameter representing number of invalid IVs.

random_start

Number of random start points for cML, default is 0.

maxit

Maximum number of iterations for each optimization.

random_seed

Random seed, an integer. Default is 0, which does not set random seed; user could specify a positive integer as random seed to get replicable results.

n

Sample size.

Value

A list contains full results of cML methods. MA_BIC_theta, MA_BIC_se, MA_BIC_p: Estimate of theta, its standard error and p-value from cML-MA-BIC. Similarly for BIC_theta, BIC_se, BIC_p from cML-BIC; for MA_AIC_theta, MA_AIC_se, MA_AIC_p from cML-MA-AIC; for AIC_DP_theta, AIC_DP_se, AIC_DP_p from cML-AIC. BIC_invalid is the set of invalid IVs selected by cML-BIC, AIC_invalid is the set of invalid IVs selected by cML-AIC. BIC_vec is the BIC vector.


xue-hr/MRcML documentation built on Aug. 25, 2024, 4:24 p.m.