mixed_corr_meta.RdCompute a mixed-type correlation matrix for an effect-size outcome and
moderator variables, using inverse-variance weights for pairs involving
the outcome and unweighted correlations for moderator-moderator pairs.
The function also bootstraps the variance-covariance matrix of the pooled
correlations and returns a mars-compatible object for path_model.
mixed_corr_meta(
data,
outcome = "yi",
variance = "vi",
moderators,
variable_types = NULL,
bootstrap = 1000,
seed = NULL,
use_fisher_z = TRUE,
min_non_missing = 4
)A data frame containing the outcome, variance, and moderator columns.
Name of the effect-size column (for example, "yi").
Name of the sampling-variance column used to define
inverse-variance weights (for example, "vi").
Character vector of moderator variable names.
Optional named character vector with values in
c("continuous","binary","ordinal"). When NULL, types are
inferred from the columns.
Number of bootstrap resamples for estimating the variance-covariance matrix.
Optional random seed for reproducibility.
Logical; if TRUE, bootstrap covariance is computed
on Fisher-z scale and transformed back to the correlation scale.
Minimum non-missing pairwise observations required to compute a correlation.
A list with class "mars_corr":
Pooled correlation matrix.
Bootstrap variance-covariance matrix of pooled correlations
in corpcor::sm2vec(corr_matrix) order.
Matrix recording the method used for each pair.
Data frame with pair, estimate, weighting, and method details.
A compact object directly consumable by path_model.
out <- mixed_corr_meta(
data = teacher_expectancy,
outcome = "yi",
variance = "vi",
moderators = c("year", "weeks", "setting", "tester"),
bootstrap = 200,
seed = 123
)
model <- "yi ~ year + weeks + setting + tester"
fit <- path_model(out, model = model, adjust_se = TRUE)