paul-buerkner/brms

Data-related post-processing for multiple imputation models via brm_multiple()

オープン

#997 opened on 2020/09/11

 (10 件のコメント) (0 件のリアクション) (0 人の担当者)R (220 件のフォーク)batch import
featuregood first issuepost-processing

Repository metrics

Stars
 (1,402 個のスター)
PR merge metrics
 (平均マージ 7d 21h) (30d で 1 merged PR)

説明

When I try to use bayes_R2() on a brmsfit_multiple object, I get a warning message that only the first imputed data set was used. I assume this means that R2 was only calculated using the first imputed dataset. I asked about this on the mc-stan discourse and it seems that R2 can be pooled from the combined posterior samples just like many other parameters. Would it be possible to add that functionality to the bayes_R2() method? I tried to look into doing it myself, but was struggling to understand the fit$fit S4 object.

library(brms)
library(mice)
imp <- mice(nhanes2)
fit <- brm_multiple(bmi ~ age + hyp + chl, data = imp, chains = 1)
bayes_R2(fit)
#>    Estimate Est.Error      Q2.5    Q97.5
#> R2 0.4452458 0.1071932 0.2068827 0.623473
#> Warning message:
#> Using only the first imputed data set. Please interpret the results with caution until a more principled approach has been implemented. 

コントリビューターガイド