# AugBalWeight: Augmented Balancing Weights as Linear Regression

[![R-CMD-check](https://img.shields.io/badge/R-CMD--check-passing-brightgreen.svg)](https://cran.r-project.org/)
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)

`AugBalWeight` implements the methodology from the Journal of the Royal Statistical Society Series B paper:
> **Bruns-Smith, D., Dukes, O., Feller, A., & Ogburn, E. L. (2026).** Augmented balancing weights as linear regression. *Journal of the Royal Statistical Society Series B: Statistical Methodology*, 88(3), 699–723. [https://doi.org/10.1093/jrsssb/qkaf019](https://doi.org/10.1093/jrsssb/qkaf019).

## Key Features

- **Numerical Equivalence**: Computes implied single linear regression coefficients $\hat{\beta}_{\text{aug}}$ combining outcome model and balancing weight parameters.
- **Double Ridge ($\ell_2$ Balancing)**: Smooth decay regularization path matching ridge regression shrinkage.
- **Double Lasso ($\ell_\infty$ Balancing)**: Soft-thresholding feature shift interpolation with double selection $I_{\text{aug}} = I_\lambda \cup I_\delta$.
- **Hyperparameter Tuning**: Flexible cross-validation algorithms for outcome model ($\lambda$), covariate balance ($\delta$), and Riesz loss.
- **Causal Estimands**: Built-in wrappers for ATE, ATT, and ATC with robust influence-function-based variance estimation.

## Installation

```r
# Install locally from source package:
install.packages("AugBalWeight_0.1.0.tar.gz", repos = NULL, type = "source")
```

## Quick Example

```r
library(AugBalWeight)

# Load canonical LaLonde dataset
data(lalonde_data)

# Estimate ATT (Average Treatment Effect on the Treated)
fit_att <- aug_bal_att(
  Y = lalonde_data$re78,
  Z = lalonde_data$treat,
  X = lalonde_data[, c("age", "educ", "black", "hisp", "married", "re74", "re75")],
  type = "l2"
)

summary(fit_att)
plot(fit_att)
```

## Citation

```bibtex
@article{bruns2026augmented,
  title={Augmented balancing weights as linear regression},
  author={Bruns-Smith, David and Dukes, Oliver and Feller, Avi and Ogburn, Elizabeth L},
  journal={Journal of the Royal Statistical Society Series B: Statistical Methodology},
  volume={88},
  number={3},
  pages={699--723},
  year={2026},
  publisher={Oxford University Press},
  doi={10.1093/jrsssb/qkaf019}
}
```
