Ejemplo n.º 1
0
    def summary(self):
        """Summary table of model estimation results"""
        smry = super(PanelEffectsResults, self).summary

        is_invalid = np.isfinite(self.f_pooled.stat)
        f_pool = _str(self.f_pooled.stat) if is_invalid else '--'
        f_pool_pval = pval_format(self.f_pooled.pval) if is_invalid else '--'
        f_pool_name = self.f_pooled.dist_name if is_invalid else '--'

        extra_text = []
        if is_invalid:
            extra_text.append('F-test for Poolability: {0}'.format(f_pool))
            extra_text.append('P-value: {0}'.format(f_pool_pval))
            extra_text.append('Distribution: {0}'.format(f_pool_name))
            extra_text.append('')

        if self.included_effects:
            effects = ', '.join(self.included_effects)
            extra_text.append('Included effects: ' + effects)

        if self.other_info is not None:
            ncol = self.other_info.shape[1]
            extra_text.append('Model includes {0} other effects'.format(ncol))
            for c in self.other_info.T:
                col = self.other_info.T[c]
                extra_text.append('Other Effect {0}:'.format(c))
                stats = 'Avg Obs: {0}, Min Obs: {1}, Max Obs: {2}, Groups: {3}'
                stats = stats.format(_str(col['mean']), _str(col['min']),
                                     _str(col['max']), int(col['total']))
                extra_text.append(stats)

        smry.add_extra_txt(extra_text)

        return smry
Ejemplo n.º 2
0
    def summary(self) -> Summary:
        """
        Model estimation summary.

        Returns
        -------
        Summary
            Summary table of model estimation results

        Supports export to csv, html and latex  using the methods ``summary.as_csv()``,
        ``summary.as_html()`` and ``summary.as_latex()``.
        """

        smry = super(PanelEffectsResults, self).summary

        is_invalid = np.isfinite(self.f_pooled.stat)
        f_pool = _str(self.f_pooled.stat) if is_invalid else "--"
        f_pool_pval = pval_format(self.f_pooled.pval) if is_invalid else "--"
        f_pool_name = self.f_pooled.dist_name if is_invalid else "--"

        extra_text = []
        if is_invalid:
            extra_text.append("F-test for Poolability: {0}".format(f_pool))
            extra_text.append("P-value: {0}".format(f_pool_pval))
            extra_text.append("Distribution: {0}".format(f_pool_name))
            extra_text.append("")

        if self.included_effects:
            effects = ", ".join(self.included_effects)
            extra_text.append("Included effects: " + effects)

        if self.other_info is not None:
            nrow = self.other_info.shape[0]
            plural = "s" if nrow > 1 else ""
            extra_text.append(f"Model includes {nrow} other effect{plural}")
            for c in self.other_info.T:
                col = self.other_info.T[c]
                extra_text.append("Other Effect {0}:".format(c))
                stats = "Avg Obs: {0}, Min Obs: {1}, Max Obs: {2}, Groups: {3}"
                stats = stats.format(
                    _str(col["mean"]),
                    _str(col["min"]),
                    _str(col["max"]),
                    int(col["total"]),
                )
                extra_text.append(stats)

        smry.add_extra_txt(extra_text)

        return smry