【问题标题】:bootstrapping mixed effect regression coefficients in statsmodels在 statsmodels 中引导混合效应回归系数
【发布时间】:2019-09-09 00:50:35
【问题描述】:

我有一个看起来像这样的混合效果模型:

import statsmodels.formula.api as smf

formula = "revised_error ~ C(condition, Treatment('solo_feedback'))*round_index"

model = smf.mixedlm(forumla, data=data, groups=data['player_id']).fit()

现在model.conf_int() 为我提供基于标准正态分布的拟合参数的置信区间。但是,我想要自举系数和置信度,但 model.boostrap() 会引发错误:

AttributeError: 'MixedLMResults' object has no attribute 'endog'

【问题讨论】:

    标签: python statsmodels statistics-bootstrap


    【解决方案1】:

    首先,您的代码有拼写错误,如果您没有更正它可能会导致一些问题:formula

    请参阅this page 上的说明,了解为什么这不适合您。到目前为止,对于复杂模型,本机不支持此功能。但是,您可以通过手动操作而不是使用 bootstrap 方法来解决此问题。

    你可以关注this notebook,看看它是如何实现的。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2022-10-06
      • 2021-07-22
      • 2020-09-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多