cat2cat.summary =============== .. py:module:: cat2cat.summary Functions --------- .. autoapisummary:: cat2cat.summary.summary_c2c Module Contents --------------- .. py:function:: summary_c2c(model: Any, df_old: float, df_new: Optional[float] = None) -> pandas.DataFrame Adjust regression summaries fitted on replicated cat2cat data. :param model: A fitted statsmodels-like result object with ``params``, ``bse``, and ``tvalues`` attributes. :param df_old: Residual degrees of freedom on the original observation scale. :param df_new: Residual degrees of freedom on the replicated data scale. Defaults to ``model.df_resid``. :returns: coefficient table with corrected standard errors, corrected statistics, corrected p-values, and reference distribution. :rtype: pandas.DataFrame .. rubric:: Examples >>> from pandas import DataFrame, concat >>> import statsmodels.api as sm >>> from cat2cat import summary_c2c >>> data = DataFrame({ ... "y": [2.0, 3.0, 5.0, 7.0, 11.0, 13.0, 17.0, 19.0], ... "x1": [1.0, 1.5, 2.0, 2.7, 3.2, 4.1, 4.8, 5.2], ... "x2": [0, 1, 0, 1, 0, 1, 0, 1], ... }) >>> model = sm.OLS.from_formula("y ~ x1 + x2", data=data).fit() >>> model_rep = sm.OLS.from_formula( ... "y ~ x1 + x2", data=concat([data, data]) ... ).fit() >>> out = summary_c2c(model_rep, df_old=model.df_resid, df_new=model_rep.df_resid) >>> all(col in out.columns for col in ["std.error_c", "statistic_c", "p.value_c"]) True