Description Usage Arguments Value Examples
View source: R/CIVMR_function.R
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.
1 | rm_outlier_IV(smooth_IV, MR.data, crit = 0.9, sigma_min = 0.01)
|
smooth_IV: |
an object from smooth_CIV() function. |
MR.data: |
data frame containing G,X,Z,Y. |
......: |
default values for other tuning parameters. |
IV_mat: the final matrix of CIV instruments.
u_mat: the final CIV solutions of u. Each column is a distinct solution.
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.
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.