confMeta | R Documentation |
Function to create objects of class confMeta
. This is the
main class within the package. For an overview of available methods
run methods(confMeta)
.
confMeta(
estimates,
SEs,
study_names = NULL,
conf_level = 0.95,
fun,
fun_name = NULL,
...
)
estimates |
A vector containing the normalized individual effect
estimates. Must be of the same length as |
SEs |
The standard errors of the normalized individual effect estimates.
Must be of the same length as |
study_names |
Either |
conf_level |
The confidence level. Must be a numeric vector of length one with it's value being in (0, 1). |
fun |
A function that combines individual effect estimates and the
corresponding standard errors into a combined p-value. The function must
have arguments named 'estimates', 'SEs', and 'mu'.
Additional arguments are also allowed, but these must either have a
default value or be passed via the |
fun_name |
A character vector of length 1. The vector serves as an
identifier for the function |
... |
Additional arguments passed to |
# Function arguments The argument `study_names` is used to differentiate between the different individual estimates. If the argument is set to `NULL`, the element 'study_names' in the return object will just be the a character vector with elements "Study n" where n is a number from 1 to `length(elements)`. These names are only used in some of the `autoplot` methods. The argument `fun` must have arguments 'estimates', 'SEs', and 'mu' but it can also have further arguments. However, these must either have a default value or need to be passed via the `...` argument. If there are additional arguments passed via `...`, `confMeta` will internally create a new function that calls `fun` with the additional arguments fixed. Thus, any any argument passed via `...` overwrites existing defaults. Since this is the p-value function that is used to calculate the combined confidence interval(s), it should return a vector of class 'numeric' with value(s) in the interval [0, 1]. # Confidence intervals The confidence intervals returned by `confMeta` are calculated as follows: The `individual_cis` are calculated as \deqn{x_{i} \pm \Phi^{-1}{\text{conf_level}} \cdot \sigma_{i}} where \eqn{x_{i}} corresponds to the elements of vector `estimates}, \eqn{\Phi^{-1}} is the quantile function of the standard normal distribution, conf_level is the confidence level passed as argument `conf_level`, and \eqn{\sigma_{i}}, are the standard errors passed in argument `SEs`. The boundaries of the confidence intervals returned in element `joint_cis` are found by searching where the function returned in element 'p_fun' is equal to 1-`conf_level`.
An S3 object of class confMeta
. The object contains the
following elements:
The normalized individual effect estimates.
The standard errors of the normalized individual effect estimates.
The names of the individual studies.
The confidence level.
The confidence intervals for the individual effects. The exact calculation of these intervals can be found in the Details section.
A function with arguments named 'estimates', 'SEs', 'conf_level', and 'mu'. This is the p-value function that is used to find the combined confidence intervals.
The name of the function. It is only used in plots as a legend entry.
The combined confidence interval(s). These are
calculated by finding the mean values where the $p$-value
function is larger than the confidence level in element
conf_level
.
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.
The local maxima of the $p$-value function. The
column 'x' refers to the mean mu
and the column 'y' contains
the corresponding $p$-value.
The value of the $p$-value at mu
= 0
Combined confindence intervals calculated with other methods. These can be used to for comparison purposes. Currently, these other methods are random effects (REML), Hartung & Knapp, and Henmi & Copas.
The same as in element 'p_0' but for the comparison methods (Random effects, Hartung & Knapp, Henmi & Copas).
# 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 (one-sided input)",
input_p = "one.sided"
)
cm2 <- confMeta(
estimates = estimates,
SEs = SEs,
conf_level = conf_level,
fun = p_edgington,
fun_name = "Edgington (two-sided input)",
input_p = "two.sided"
)
# Plot the object
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.