Bi_TSLS {BiTSLS}R Documentation

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:

  • X: Treatment/exposure variable

  • Y: Outcome variable

  • Z: Negative control exposure (proxy variable)

  • W: Negative control outcome (proxy variable)

  • At least one additional covariate (required)

R_w

Sensitivity parameter for W (default = 0)

R_z

Sensitivity parameter for Z (default = 0)

Value

A list containing:

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)

[Package BiTSLS version 0.1.0 Index]