rm_outlier_IV: select IVs from a smooth_IV object (experimental function).

Description Usage Arguments Value Examples

View source: R/CIVMR_function.R

Description

this function removes IVs with extreme low correlation and extreme high prediction error. This is an experimental function to check how many redundant solutions are found in smooth.opt object.

Usage

1
rm_outlier_IV(smooth_IV, MR.data, crit = 0.9, sigma_min = 0.01)

Arguments

smooth_IV:

an object from smooth_CIV() function.

MR.data:

data frame containing G,X,Z,Y.

......:

default values for other tuning parameters.

Value

IV_mat: the final matrix of CIV instruments.

u_mat: the final CIV solutions of u. Each column is a distinct solution.

Examples

1
2
3
4
5
6
7
8
data(simulation)
G <- simulation$G
X <- simulation$X
Z <- simulation$Z
Y <- simulation$Y
smooth.opt <- smooth_CIV( G,X,Z,Y, k_folds = 10)
smooth.clean <- rm_outlier_IV(smooth.opt, simulation)
dim(smooth.clean$u_mat) #check how many solutions are different. It is probability much less than 100.

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