Metadata-Version: 2.4
Name: multi-levelSC
Version: 0.1
Summary: Package to implement the multi-level SC estimator
Author: null
License-Expression: Apache-2.0
Project-URL: Homepage, https://github.com/leabottmer/multi-level-sc-estimator
Project-URL: Changelog, https://github.com/leabottmer/multi-level-sc-estimator/releases
Project-URL: Issues, https://github.com/leabottmer/multi-level-sc-estimator/issues
Project-URL: CI, https://github.com/leabottmer/multi-level-sc-estimator/actions
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy
Requires-Dist: cvxpy
Requires-Dist: pandas
Requires-Dist: ray
Requires-Dist: scipy
Provides-Extra: test
Requires-Dist: pytest; extra == "test"
Dynamic: license-file

# Multi-level Synthetic Control Estimator

[![PyPI](https://img.shields.io/pypi/v/multi-level-sc-estimator.svg)](https://pypi.org/project/multi-level-sc-estimator/)
[![Tests](https://github.com/leabottmer/multi-level-sc-estimator/actions/workflows/test.yml/badge.svg)](https://github.com/leabottmer/multi-level-sc-estimator/actions/workflows/test.yml)
[![Changelog](https://img.shields.io/github/v/release/leabottmer/multi-level-sc-estimator?include_prereleases&label=changelog)](https://github.com/leabottmer/multi-level-sc-estimator/releases)
[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/leabottmer/multi-level-sc-estimator/blob/main/LICENSE)

This package implements the multi-level SC estimator (mlSC) for the treatment effect for a single, treated, aggregated unit in panel data with multiple levels of aggregation, as proposed in Bottmer (2025). 

This package is currently in beta and the functionality and interface is subject to change.

## Installation

Install this library using `pip`:
```bash
pip install multi-level-sc-estimator
```
## Example

```bash
from multi_level_sc_estimator.mlSC import mlSC_estimator

# Define data sets, treated unit, treated period, population weights (w_c) and how to estimate lambda.
mlSC_results = mlSC_estimator(data_s,data_c, idx, n_c, t, w_c, lambda_est = "heuristic")
tau_hat = mlSC_results[0]
lambda_hat = mlSC_results[1]
w_hat = mlSC_results[2]
```

## References
Lea Bottmer. **Synthetic Control with Disaggregated Data**, 2025. [[link]](https://leabottmer.github.io/job_market/jmp_bottmer.pdf)

<!--
## Development

To contribute to this library, first checkout the code. Then create a new virtual environment:
```bash
cd multi-level-sc-estimator
python -m venv venv
source venv/bin/activate
```
Now install the dependencies and test dependencies:
```bash
python -m pip install -e '.[test]'
```
To run the tests:
```bash
python -m pytest
```
-->
