Skip to content

Commit

Permalink
fix from dompas (benmiroglio#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrico-bu-uab committed Mar 14, 2023
1 parent b5582b6 commit dac8a51
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions build/lib/pymatch/Matcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,9 @@ def prop_test(self, col):
"""
if not uf.is_continuous(col, self.X) and col not in self.exclude:
is_continuous = (col in self.X.columns) or ("Q('{}')".format(col) in self.X.columns)
if (not is_continuous) and (not (col in self.exclude)):
# if not uf.is_continuous(col, self.X) and col not in self.exclude:
pval_before = round(stats.chi2_contingency(self.prep_prop_test(self.data,
col))[1], 6)
pval_after = round(stats.chi2_contingency(self.prep_prop_test(self.matched_data,
Expand Down Expand Up @@ -299,7 +301,9 @@ def compare_continuous(self, save=False, return_table=False):
"""
test_results = []
for col in self.matched_data.columns:
if uf.is_continuous(col, self.X) and col not in self.exclude:
is_continuous = (col in self.X.columns) or ("Q('{}')".format(col) in self.X.columns)
if is_continuous and (not (col in self.exclude)):
# if uf.is_continuous(col, self.X) and col not in self.exclude:
# organize data
trb, cob = self.test[col], self.control[col]
tra = self.matched_data[self.matched_data[self.yvar]==True][col]
Expand Down Expand Up @@ -405,7 +409,9 @@ def prep_plot(data, var, colname):
'''
test_results = []
for col in self.matched_data.columns:
if not uf.is_continuous(col, self.X) and col not in self.exclude:
is_continuous = (col in self.X.columns) or ("Q('{}')".format(col) in self.X.columns)
if (not is_continuous) and (not (col in self.exclude)):
# if not uf.is_continuous(col, self.X) and col not in self.exclude:
dbefore = prep_plot(self.data, col, colname="before")
dafter = prep_plot(self.matched_data, col, colname="after")
df = dbefore.join(dafter)
Expand Down

0 comments on commit dac8a51

Please sign in to comment.