Skip to content

Commit

Permalink
[IV 212] adding axis labels with Ben's comments
Browse files Browse the repository at this point in the history
Signed-off-by: Nathaniel <[email protected]>
  • Loading branch information
NathanielF committed Aug 23, 2023
1 parent f737115 commit 2e1d692
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 91 deletions.
7 changes: 4 additions & 3 deletions causalpy/pymc_experiments.py
Original file line number Diff line number Diff line change
Expand Up @@ -1002,11 +1002,12 @@ def _input_validation(self):
as an outcome variable and in the data object to be used as a covariate.
"""
)
check_binary = len(self.data[treatment.strip()].unique()) > 2
Z = self.data[treatment.strip()]
check_binary = len(np.unique(Z)) > 2
if check_binary:
warnings.warn(
"""Warning. The treatment variable is not Binary.
This is not necessarily aproblem but it violates
This is not necessarily a problem but it violates
the assumption of a simple IV experiment.
Change your interpretation of model coefficients accordingly."""
The coefficients should be interpreted appropriately."""
)
3 changes: 1 addition & 2 deletions causalpy/pymc_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,7 @@ def build_model(self, X, Z, y, t, coords, priors):
:param priors: An optional dictionary of priors for the mus and
sigmas of both regressions
e.g priors = {'mus': [[10, 0], [2, 0]], 'sigmas': [[1, 1], [1, 1]]
'eta': 2, 'lkj_sd': 2}
:code:`priors = {"mus": [0, 0], "sigmas": [1, 1], "eta": 2, "lkj_sd": 2}`
"""

Expand Down
163 changes: 77 additions & 86 deletions docs/source/notebooks/iv_pymc.ipynb

Large diffs are not rendered by default.

0 comments on commit 2e1d692

Please sign in to comment.