Skip to content

Commit

Permalink
ENH/REF: contrast results: string for float df_num, df_denom
Browse files Browse the repository at this point in the history
  • Loading branch information
josef-pkt committed Jan 29, 2019
1 parent b536483 commit 396452b
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions statsmodels/stats/contrast.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,14 @@ def summary(self, xname=None, alpha=0.05, title=None):
return summ
elif hasattr(self, 'fvalue'):
# TODO: create something nicer for these casee
return '<F test: F=%s, p=%s, df_denom=%d, df_num=%d>' % \
(repr(self.fvalue), self.pvalue, self.df_denom, self.df_num)
return '<F test: F=%s, p=%s, df_denom=%s, df_num=%s>' % \
(repr(self.fvalue), self.pvalue,
str(round(self.df_denom, 3)),
str(round(self.df_num, 3)))
elif self.distribution == 'chi2':
return '<Wald test (%s): statistic=%s, p-value=%s, df_denom=%d>' % \
(self.distribution, self.statistic, self.pvalue, self.df_denom)
return '<Wald test (%s): statistic=%s, p-value=%s, df_denom=%s>' % \
(self.distribution, self.statistic, self.pvalue,
str(round(self.df_denom, 3)))
else:
# generic
return '<Wald test: statistic=%s, p-value=%s>' % \
Expand Down

0 comments on commit 396452b

Please sign in to comment.