| confMeta | R Documentation |
confMeta objectsFunction to create objects of class confMeta. This is the
main class within the package. For an overview of available methods
run methods(class = "confMeta").
confMeta(
estimates,
SEs,
study_names = NULL,
conf_level = 0.95,
fun,
fun_name = NULL,
w = NULL,
MH = FALSE,
table_2x2 = NULL,
measure = NULL,
method.tau.re = "REML",
method.tau.hk = "REML",
method.tau.het = "REML",
adhoc.hakn.ci = "IQWiG6",
...
)
estimates |
A vector containing the individual effect estimates. These should be on
a scale where they are approximately normally distributed (e.g., log odds ratios, log risk
ratios, mean differences). Must be of the same length as |
SEs |
The standard errors of the individual effect estimates.
Must be of the same length as |
study_names |
Optional vector of study identifiers. If |
conf_level |
The confidence level (numeric scalar between 0 and 1). |
fun |
A function that combines estimates and SEs into a combined p-value.
The function must accept arguments |
fun_name |
A character vector of length 1. Label for |
w |
Numeric vector of weights for the studies. Must be of
the same length as |
MH |
Logical. If |
table_2x2 |
A data frame containing the 2x2 contingency table data for
Mantel-Haenszel pooling. Required if |
measure |
A character string indicating the effect measure to be used
for Mantel-Haenszel pooling (e.g., "OR", "RR", "RD"). Required if
|
method.tau.re |
Character string indicating which between-study variance
estimator to use for random-effects meta-analysis
(e.g., |
method.tau.hk |
Character string indicating which between-study variance
estimator to use for the Hartung-Knapp meta-analysis. Defaults to |
method.tau.het |
Character string indicating which between-study variance
estimator to use for calculating the general heterogeneity statistics in
|
adhoc.hakn.ci |
Character string indicating the variance correction
method for the Hartung-Knapp confidence intervals (e.g., |
... |
Additional arguments passed to |
An S3 object of class confMeta containing the following elements:
estimates, SEs, w, study_names, conf_level: Values
used to build the object.
individual_cis: Matrix of Wald-type confidence intervals for each study.
p_fun: The p-value function used for combined inference.
joint_cis: Combined confidence interval(s). Calculated
by finding the values where the p-value function is larger
than the significant level (1 - conf_level).
gamma: The local minima within the range of the individual effect
estimates. Column x refers to the mean \mu and column y
contains the corresponding p-value.
p_max: The local maxima of the p-value function. Column x
refers to the mean \mu and column y contains the corresponding
p-value.
p_0: The value of the p-value at \mu = 0.
comparison_cis: Combined confidence intervals calculated with other
methods. These can be used for comparison purposes. Currently, these
other methods are fixed effect (IV or Mantel-Haenszel), random effects (IV),
Hartung & Knapp, and Henmi & Copas.
comparison_p_0: The same as in element p_0 but for the comparison
methods (fixed effect, random effects, Hartung & Knapp, Henmi & Copas).
heterogeneity: A data frame with columns Q (Cochran's Q),
p_Q (p-value for Q), I2 (I^2), Tau (\tau),
I2_lower, and I2_upper, computed using the estimator defined
by method.tau.het.
table_2x2: The 2x2 table data frame (if provided), otherwise NULL.
Individual confidence intervals are calculated as:
x_i \pm \Phi^{-1}(1 - \alpha/2) \cdot \sigma_i
where x_i are the estimates, \sigma_i the SEs, and
\alpha = 1 - \mathrm{conf\_level}.
Combined confidence intervals are found by inverting the p-value function,
identifying all \mu where the p-value exceeds the significance level (1 - conf_level).
Also, the HK method uses adhoc.hakn.ci = "IQWiG6" by default, i.e., it uses variance correction if the HK confidence interval
is narrower than the CI from the classic random effects model with the DerSimonian-Laird estimator (IQWiG, 2022).
p_value_functions, autoplot.confMeta
# Simulate effect estimates and standard errors
set.seed(42)
n <- 5
estimates <- rnorm(n)
SEs <- rgamma(n, 5, 5)
conf_level <- 0.95
# Construct a simple confMeta object using p_edgington as
# the p-value function
cm <- confMeta(
estimates = estimates,
SEs = SEs,
conf_level = conf_level,
fun = p_edgington,
fun_name = "Edgington",
input_p = "greater"
)
cm2 <- confMeta(
estimates = estimates,
SEs = SEs,
conf_level = conf_level,
fun = p_edgington_w,
w = 1/SEs,
fun_name = "Edgington (1/SE)",
input_p = "greater"
)
# print the objects
cm
cm2
# Plot the objects
autoplot(cm, cm2, type = "p") # p-value function plot
autoplot(cm, cm2, type = "forest") # forest plot
autoplot(cm, cm2, type = c("p", "forest")) # both
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.