-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix error in plot method #257
Comments
I think there is a general issue withe the plot function for difference in differences class
|
Hi @juliangardin. Would you be able to create a new issue with a minimum working example - i.e. what steps you took which resulted in the error? And clarify which version of CausalPy you are running. |
@drbenvincent I was running the did-pymc example here: https://causalpy.readthedocs.io/en/stable/notebooks/did_pymc.html Version = 0.2.2 |
So I re-ran the notebook using the development version of CausalPy and no errors. To see if it's a bug that was fixed between 0.2.2 and the development version I created a new environment and ran the commands from that notebook in ipython. set up env conda create -c conda-forge -n causalpydebug "pymc>=5" "causalpy==0.2.2"
conda activate causalpydebug
ipython Then in that ipython session I ran import arviz as az
import causalpy as cp
import matplotlib.pyplot as plt
seed = 42
df = cp.load_data("did")
result = cp.pymc_experiments.DifferenceInDifferences(
df,
formula="y ~ 1 + group*post_treatment",
time_variable_name="t",
group_variable_name="group",
model=cp.pymc_models.LinearRegression(sample_kwargs={"random_seed": seed}),
)
fig, ax = result.plot()
plt.show() and the image appeared fine. There is a bug with Sorry, but I can't reproduce the bug so far. Feel free to create an issue with all the steps to see if we can reproduce the issue. |
When calling
result.plot()
we are getting an error:did_pymc_banks.ipynb
,did_pymc.ipynb
.result.plot()
executes ok.The text was updated successfully, but these errors were encountered: