Type: | Package |
Title: | Bidirectional Two-Stage Least Squares Estimation |
Version: | 0.1.0 |
Date: | 2025-05-26 |
Description: | Implements bidirectional two-stage least squares (Bi-TSLS) estimation for identifying bidirectional causal effects between two variables in the presence of unmeasured confounding. The method uses proxy variables (negative control exposure and outcome) along with at least one covariate to handle confounding. |
License: | MIT + file LICENSE |
Encoding: | UTF-8 |
Imports: | stats |
RoxygenNote: | 7.3.1 |
Depends: | R (≥ 3.5.0) |
NeedsCompilation: | no |
Packaged: | 2025-05-26 14:13:24 UTC; Mjq |
Author: | Jiaqi Min [aut, cre] |
Maintainer: | Jiaqi Min <fhoneysuckle7@gmail.com> |
Repository: | CRAN |
Date/Publication: | 2025-05-28 15:30:06 UTC |
Bidirectional Two-Stage Least Squares Estimation
Description
Performs bidirectional two-stage least squares (Bi-TSLS) estimation to identify bidirectional causal effects between X and Y using proxy variables Z and W. Requires at least one covariate in addition to X, Y, Z, and W.
Usage
Bi_TSLS(data, R_w = 0, R_z = 0)
Arguments
data |
A data frame containing at least these variables:
|
R_w |
Sensitivity parameter for W (default = 0) |
R_z |
Sensitivity parameter for Z (default = 0) |
Value
A list containing:
beta_XY: Estimated effect of X on Y
beta_YX: Estimated effect of Y on X
Examples
# Create example data with covariate
n <- 1000
data <- data.frame(
X = rnorm(n),
Y = rnorm(n),
Z = rnorm(n),
W = rnorm(n),
V = rnorm(n) # At least one covariate is required
)
# Run BiTSLS
result <- Bi_TSLS(data)
print(result)