Skip to content

Commit

Permalink
Changing test_generalize for AIPSW confounder update
Browse files Browse the repository at this point in the history
  • Loading branch information
pzivich committed Mar 31, 2019
1 parent fe0db7f commit e4591db
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/test_generalize.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,13 +160,13 @@ def test_generalize_conf(self, df_iptw):
aipw.weight_model('L + W_sq', print_results=False)
aipw.outcome_model('A + L + L:A + W_sq + W_sq:A + W_sq:A:L', print_results=False)
aipw.fit()
npt.assert_allclose(aipw.risk_difference, 0.043744, atol=1e-5)
npt.assert_allclose(aipw.risk_ratio, 1.131651, atol=1e-4)
npt.assert_allclose(aipw.risk_difference, 0.048129, atol=1e-5)
npt.assert_allclose(aipw.risk_ratio, 1.146787, atol=1e-4)

def test_transport_conf(self, df_iptw):
aipw = AIPSW(df_iptw, exposure='A', outcome='Y', selection='S', generalize=True, weights='iptw')
aipw = AIPSW(df_iptw, exposure='A', outcome='Y', selection='S', generalize=False, weights='iptw')
aipw.weight_model('L + W_sq', print_results=False)
aipw.outcome_model('A + L + L:A + W_sq + W_sq:A + W_sq:A:L', print_results=False)
aipw.fit()
npt.assert_allclose(aipw.risk_difference, 0.043744, atol=1e-5)
npt.assert_allclose(aipw.risk_ratio, 1.131651, atol=1e-4)
npt.assert_allclose(aipw.risk_difference, 0.041407, atol=1e-5)
npt.assert_allclose(aipw.risk_ratio, 1.120556, atol=1e-4)

0 comments on commit e4591db

Please sign in to comment.