Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 29 additions & 31 deletions docs/source/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,52 +13,50 @@ A Python package focussing on causal inference for quasi-experiments. The packag
To get the latest release you can use pip:

```bash
pip install CausalPy
pip install CausalPy
```

or conda:

```bash
conda install causalpy -c conda-forge
conda install causalpy -c conda-forge
```

Alternatively, if you want the very latest version of the package you can install from GitHub:

```bash
pip install git+https://github.com/pymc-labs/CausalPy.git
pip install git+https://github.com/pymc-labs/CausalPy.git
```

## Quickstart

```python

import causalpy as cp
import matplotlib.pyplot as plt


# Import and process data
df = (
cp.load_data("drinking")
.rename(columns={"agecell": "age"})
.assign(treated=lambda df_: df_.age > 21)
)

# Run the analysis
result = cp.RegressionDiscontinuity(
df,
formula="all ~ 1 + age + treated",
running_variable_name="age",
model=cp.pymc_models.LinearRegression(),
treatment_threshold=21,
)

# Visualize outputs
fig, ax = result.plot();

# Get a results summary
result.summary()

plt.show()
import causalpy as cp
import matplotlib.pyplot as plt


# Import and process data
df = (
cp.load_data("drinking")
.rename(columns={"agecell": "age"})
.assign(treated=lambda df_: df_.age > 21)
)

# Run the analysis
result = cp.RegressionDiscontinuity(
df,
formula="all ~ 1 + age + treated",
running_variable_name="age",
model=cp.pymc_models.LinearRegression(),
treatment_threshold=21,
)

# Visualize outputs
fig, ax = result.plot()
# Get a results summary
result.summary()

plt.show()
```

## Videos
Expand Down