Skip to content

Commit d40d268

Browse files
committed
add anova1 example to integration tests
1 parent c12d11a commit d40d268

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

causalpy/tests/test_integration_pymc_examples.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,3 +218,19 @@ def test_sc_brexit():
218218
len(result.prediction_model.idata.posterior.coords["draw"])
219219
== sample_kwargs["draws"]
220220
)
221+
222+
223+
@pytest.mark.integration
224+
def test_ancova():
225+
df = cp.load_data("anova1")
226+
result = cp.pymc_experiments.PrePostNEGD(
227+
df,
228+
formula="post ~ 1 + C(group) + pre",
229+
group_variable_name="group",
230+
pretreatment_variable_name="pre",
231+
prediction_model=cp.pymc_models.LinearRegression(),
232+
)
233+
assert isinstance(df, pd.DataFrame)
234+
assert isinstance(result, cp.pymc_experiments.LinearRegression)
235+
assert len(result.idata.posterior.coords["chain"]) == sample_kwargs["chains"]
236+
assert len(result.idata.posterior.coords["draw"]) == sample_kwargs["draws"]

0 commit comments

Comments
 (0)