wwiecek / baggr

R package for Bayesian meta-analysis models, using Stan
GNU General Public License v3.0
46 stars 12 forks source link

Add study-specific weights in the model #94

Closed wwiecek closed 2 years ago

wwiecek commented 3 years ago

As per Rubin 1981. Rachael Meager says:

Call the sampling variance of the study k plus the hypervariance the "total variance for study k". the inverse of that is the "total precision for study k". The weight on study k is that study's total precision normalized by the sum of all the K precisions (so the weights sum to 1)

wwiecek commented 2 years ago
mean_weights_proto <- function(x) {
  mean_hypervar <- mean(treatment_effect(x)$sigma_tau)
  dt <- prepare_ma(x$data, effect = "logOR")
  studyvar <- (dt$se)^2
  names(studyvar) <- dt$group
  study_prec <- 1 / (mean_hypervar + studyvar)
  study_prec/sum(study_prec)
}
wwiecek commented 2 years ago

Now done in pooling()