paul-buerkner/brms
Vedi su GitHubData-related post-processing for multiple imputation models via brm_multiple()
Open
#997 aperta il 11 set 2020
featuregood first issuepost-processing
Metriche repository
- Star
- (1402 star)
- Metriche merge PR
- (Merge medio 7g 21h) (1 PR mergiata in 30 g)
Descrizione
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.