Skip to content

Commit b264193

Browse files
authored
remove spaces from previous code-block (#527)
1 parent 91ecda2 commit b264193

File tree

1 file changed

+29
-31
lines changed

1 file changed

+29
-31
lines changed

docs/source/index.md

Lines changed: 29 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -13,52 +13,50 @@ A Python package focussing on causal inference for quasi-experiments. The packag
1313
To get the latest release you can use pip:
1414

1515
```bash
16-
pip install CausalPy
16+
pip install CausalPy
1717
```
1818

1919
or conda:
2020

2121
```bash
22-
conda install causalpy -c conda-forge
22+
conda install causalpy -c conda-forge
2323
```
2424

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

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

3131
## Quickstart
3232

3333
```python
34-
35-
import causalpy as cp
36-
import matplotlib.pyplot as plt
37-
38-
39-
# Import and process data
40-
df = (
41-
cp.load_data("drinking")
42-
.rename(columns={"agecell": "age"})
43-
.assign(treated=lambda df_: df_.age > 21)
44-
)
45-
46-
# Run the analysis
47-
result = cp.RegressionDiscontinuity(
48-
df,
49-
formula="all ~ 1 + age + treated",
50-
running_variable_name="age",
51-
model=cp.pymc_models.LinearRegression(),
52-
treatment_threshold=21,
53-
)
54-
55-
# Visualize outputs
56-
fig, ax = result.plot();
57-
58-
# Get a results summary
59-
result.summary()
60-
61-
plt.show()
34+
import causalpy as cp
35+
import matplotlib.pyplot as plt
36+
37+
38+
# Import and process data
39+
df = (
40+
cp.load_data("drinking")
41+
.rename(columns={"agecell": "age"})
42+
.assign(treated=lambda df_: df_.age > 21)
43+
)
44+
45+
# Run the analysis
46+
result = cp.RegressionDiscontinuity(
47+
df,
48+
formula="all ~ 1 + age + treated",
49+
running_variable_name="age",
50+
model=cp.pymc_models.LinearRegression(),
51+
treatment_threshold=21,
52+
)
53+
54+
# Visualize outputs
55+
fig, ax = result.plot()
56+
# Get a results summary
57+
result.summary()
58+
59+
plt.show()
6260
```
6361

6462
## Videos

0 commit comments

Comments
 (0)