Skip to content

Commit 6323c11

Browse files
committed
fixing doctest
Signed-off-by: Nathaniel <[email protected]>
1 parent 60e5ee4 commit 6323c11

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

causalpy/pymc_experiments.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1499,12 +1499,12 @@ class InversePropensityWeighting(ExperimentalDesign, PropensityDataValidator):
14991499
Example
15001500
--------
15011501
>>> import causalpy as cp
1502-
>>> df = cp.load_data("rd")
1502+
>>> df = cp.load_data("nhefs")
15031503
>>> seed = 42
15041504
>>> result = cp.pymc_experiments.InversePropensityWeighting(
15051505
... df,
1506-
... formula="t ~ 1 + x",
1507-
... outcome_variable ="y",
1506+
... formula="trt ~ 1 + age + race",
1507+
... outcome_variable ="outcome",
15081508
... weighting_scheme="robust",
15091509
... model=cp.pymc_models.PropensityScore(
15101510
... sample_kwargs={

causalpy/pymc_models.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -390,11 +390,11 @@ class PropensityScore(ModelBuilder):
390390
>>> import numpy as np
391391
>>> from causalpy.pymc_models import PropensityScore
392392
>>> df = cp.load_data('nhefs')
393-
>>> X = df[["outcome", "trt", "age", "race"]]
394-
>>> t = np.asarray(df["trt"]).reshape((df["trt"].shape[0],1))
393+
>>> X = df[["age", "race"]]
394+
>>> t = np.asarray(df["trt"])
395395
>>> ps = PropensityScore(sample_kwargs={"progressbar": False})
396-
>>> ps.fit(X, y, coords={
397-
... 'coeffs': ['trt', 'age', 'race'],
396+
>>> ps.fit(X, t, coords={
397+
... 'coeffs': ['age', 'race'],
398398
... 'obs_indx': np.arange(df.shape[0])
399399
... },
400400
... )

0 commit comments

Comments
 (0)