paul-buerkner/brms

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

Open

#997 ouverte le 11 sept. 2020

Voir sur GitHub
 (10 commentaires) (0 réactions) (0 assignés)R (220 forks)batch import
featuregood first issuepost-processing

Métriques du dépôt

Stars
 (1 402 stars)
Métriques de merge PR
 (Merge moyen 7j 21h) (1 PR mergée en 30 j)

Description

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. 

Guide contributeur