Skip to content

Commit 3edfed5

Browse files
committed
2.4.2 - fix:
1 parent 3fcc667 commit 3edfed5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

clarite/modules/analyze/regression/glm_regression.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,8 @@ def __init__(
139139
# TODO: Allow only 0/1 or Control/Case entries | Other entries generate a warning
140140

141141
codes, categories = zip(*enumerate(categories))
142-
self.data[self.outcome_variable].replace(categories, codes, inplace=True)
142+
# self.data[self.outcome_variable].replace(categories, codes, inplace=True)
143+
self.data[self.outcome_variable] = self.data[self.outcome_variable].replace(categories, codes)
143144

144145
# After upgrade to Pandas >= 1.5 the replace stop to covert as float
145146
# if stay as category, when create y will create to columns and will invert the
@@ -153,7 +154,7 @@ def __init__(
153154
f"\t{counts[categories[0]]:,} occurrences of '{categories[0]}' coded as 0\n"
154155
f"\t{counts[categories[1]]:,} occurrences of '{categories[1]}' coded as 1"
155156
)
156-
self.family = sm.families.Binomial(link=sm.families.links.logit())
157+
self.family = sm.families.Binomial(link=sm.families.links.Logit())
157158
self.use_t = False
158159
else:
159160
raise ValueError(

0 commit comments

Comments
 (0)