Skip to content

Commit

Permalink
fix print_summary() for alpha != 0.05
Browse files Browse the repository at this point in the history
  • Loading branch information
wingkitlee0 authored and CamDavidsonPilon committed Oct 7, 2019
1 parent 0c4781c commit a314792
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions lifelines/fitters/coxph_fitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -1303,23 +1303,23 @@ def print_summary(self, decimals=2, **kwargs):

df = self.summary
df.columns = [leading_space(c) for c in df.columns]

ci = 100 * (1 - self.alpha)
print(
df.to_string(
float_format=format_floats(decimals),
formatters={
leading_space("exp(coef)"): format_exp_floats(decimals),
leading_space("exp(coef) lower 95%"): format_exp_floats(decimals),
leading_space("exp(coef) upper 95%"): format_exp_floats(decimals),
leading_space("exp(coef) lower %g%%" % ci): format_exp_floats(decimals),
leading_space("exp(coef) upper %g%%" % ci): format_exp_floats(decimals),
},
columns=[
leading_space("coef"),
leading_space("exp(coef)"),
leading_space("se(coef)"),
leading_space("coef lower 95%"),
leading_space("coef upper 95%"),
leading_space("exp(coef) lower 95%"),
leading_space("exp(coef) upper 95%"),
leading_space("coef lower %g%%" % ci),
leading_space("coef upper %g%%" % ci),
leading_space("exp(coef) lower %g%%" % ci),
leading_space("exp(coef) upper %g%%" % ci),
],
)
)
Expand Down

0 comments on commit a314792

Please sign in to comment.