TScMLStage2 | R Documentation |
This function fitting the second stage of 2ScML is the main function of our proposed method. It applies Truncated L1 Constraint in the second stage regression to select invalid instruments.
TScMLStage2(
gamma.hat.stage1,
cor.Y2Z2,
Estimated.Sigma,
n1,
n2,
p,
K.vec.stage2 = 0:(p/2),
posdef = 1e-04,
Est.Sigma1Square,
Est.Sigma2Square
)
gamma.hat.stage1 |
A vector of length p, containing estimated effects from IVs to exposure obtained in the first stage model. |
cor.Y2Z2 |
A vector of length p, containing sample correlations (summary data) between outcome Y and p IVs calculated with the second sample. |
Estimated.Sigma |
Estimated correlation matrix with reference panel. |
n1 |
Sample size in first stage. |
n2 |
Sample size in second stage. |
p |
Number of instruments. |
K.vec.stage2 |
Set of candidate K's being used in the constraint. |
posdef |
A small positive constant to be added on diagonal of covariance matrix to ensure it is positive definite. |
Est.Sigma1Square |
A number, estimated variance of random error in the first stage. |
Est.Sigma2Square |
A number, estimated variance of random error in the second stage. |
This function returns a list with three elements, (1) betaalpha.hat.stage2: a vector of length (p+1), the first element is the estimated beta (causal effect from exposure to outcome), the rest p elements are estimated alpha's (direct effects from IVs to outcome); (2) Asympt.Var.BetaHat: the uncorrected estimated variance for estimated beta. (3) BIC.vec.stage2: the vector of BIC, having the same length as K.vec.stage2.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.