heterogeneity_metrics_for_forest: heterogeneity_metrics_for_forest

View source: R/heterogeneity_metrics_for_forest.r

heterogeneity_metrics_for_forestR Documentation

heterogeneity_metrics_for_forest

Description

This function converts a metafor metaanalysis fit object to a string that contains the I^2 and H^2 heterogeneity statistics so that it can easily be added to a metafor forest plot.

Usage

heterogeneity_metrics_for_forest(fit)

Arguments

fit

The meta analysis fit object outputted by sced_meta_analysis()

Examples

# calculate participant level results
results <- sced_analysis(data = data)

# fit meta
sced_meta_fit <- sced_meta_analysis(results = results, effect_size = "ruscios_A")

# forest plot
metafor::forest(sced_meta_fit$model_fit,
                xlab = "Probability of superiority",
                transf = boot::inv.logit,  # convert logits back to probabilities (ie Ruscio's A)
                mlab = heterogeneity_metrics_for_forest(sced_meta_fit$model_fit),
                digits = 2,
                addcred = TRUE,
                refline = 0.5)
                

ianhussey/SCED documentation built on Aug. 25, 2022, 4:42 p.m.