models.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:pyprocessmacro 作者: QuentinAndre 项目源码 文件源码
def _estimate(self):
        """
        Estimates the direct effect of X on Y, and return the results into as a dictionary.
        :return: dict
            A dictionary of parameters and model estimates.
        """
        mod_values = [i for i in product(*self._moderators_values)]
        mod_symb = self._moderators_symb
        betas, se, llci, ulci = self._get_conditional_direct_effects(mod_symb, mod_values)
        t = betas / se
        if self._is_logit:
            p = stats.norm.sf(np.abs(t)) * 2
        else:
            df_e = self._model.estimation_results["df_e"]
            p = stats.t.sf(np.abs(t), df_e) * 2
        estimation_results = {"betas": betas,
                              "se": se,
                              "t": t,
                              "p": p,
                              "llci": llci,
                              "ulci": ulci}
        return estimation_results
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号