mr_cML_DP: MRcML method with Data Perturbation

View source: R/mr_cML_DP.R

mr_cML_DPR Documentation

MRcML method with Data Perturbation

Description

This is the main function of MRcML method with data perturbation.

Usage

mr_cML_DP(
  b_exp,
  b_out,
  se_exp,
  se_out,
  K_vec = 0:(length(b_exp) - 2),
  random_start = 0,
  random_start_pert = 0,
  maxit = 100,
  num_pert = 200,
  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.

random_start_pert

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

maxit

Maximum number of iterations for each optimization.

num_pert

Number of perturbation, default is 200.

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_BIC_DP_theta, MA_BIC_DP_se, MA_BIC_DP_p from cML-MA-BIC-DP; for BIC_DP_theta, BIC_DP_se, BIC_DP_p from cML-BIC-DP. BIC_invalid is the set of invalid IVs selected by cML-BIC.


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