
Mixed Correlations for Study-Level Path Analysis
Mixed-Correlation-Path-Workflow.Rmdmixed_corr_meta() computes associations across rows of
effect sizes and moderators. This is a study-level analysis, distinct
from pooling participant-level correlation matrices reported by multiple
studies. These associations do not establish participant-level
relationships or causal mediation.
Observed-scale correlations with common weights
set.seed(205)
k <- 120
x <- rnorm(k)
binary <- factor(rep(c("no","yes"),k/2))
ordinal <- ordered(cut(x+rnorm(k),breaks=c(-Inf,-.7,0,.7,Inf),labels=1:4))
d <- data.frame(study=1:k,yi=.3*x+.2*(binary=="yes")+rnorm(k,sd=.4),
vi=runif(k,.02,.08),x=x,binary=binary,ordinal=ordinal)
mixed <- mixed_corr_meta(d,moderators=c("x","binary","ordinal"),
bootstrap=250,seed=12,cluster_id="study")
mixed$corr_matrix
#> yi x binary ordinal
#> yi 1.0000000 0.55783036 0.20160803 0.30996922
#> x 0.5578304 1.00000000 0.06952258 0.55268380
#> binary 0.2016080 0.06952258 1.00000000 0.03458148
#> ordinal 0.3099692 0.55268380 0.03458148 1.00000000
mixed$method_matrix
#> yi x
#> yi "diag" "weighted_pearson"
#> x "weighted_pearson" "diag"
#> binary "weighted_point_biserial" "weighted_point_biserial"
#> ordinal "weighted_pearson_scores" "weighted_pearson_scores"
#> binary ordinal
#> yi "weighted_point_biserial" "weighted_pearson_scores"
#> x "weighted_point_biserial" "weighted_pearson_scores"
#> binary "diag" "weighted_pearson_scores"
#> ordinal "weighted_pearson_scores" "diag"
mixed$pair_details
#> var1 var2 estimate method weighted n_used effective_n
#> 1 yi x 0.55783036 weighted_pearson TRUE 120 101.5983
#> 2 yi binary 0.20160803 weighted_point_biserial TRUE 120 101.5983
#> 3 yi ordinal 0.30996922 weighted_pearson_scores TRUE 120 101.5983
#> 4 x binary 0.06952258 weighted_point_biserial TRUE 120 101.5983
#> 5 x ordinal 0.55268380 weighted_pearson_scores TRUE 120 101.5983
#> 6 binary ordinal 0.03458148 weighted_pearson_scores TRUE 120 101.5983
mixed$bootstrap_diagnostics
#> $requested
#> [1] 250
#>
#> $accepted
#> [1] 250
#>
#> $rejected
#> [1] 0
#>
#> $success_rate
#> [1] 1
#>
#> $independent_units
#> [1] 120
#>
#> $resampling
#> [1] "clusters"
#>
#> $fallback_pairs
#> [1] 0
#>
#> $sufficient
#> [1] TRUEThe defaults, correlation_scale="observed" and
weighting="inverse_variance", apply the same
1/vi weights to every pair. Continuous pairs use weighted
Pearson correlations, binary-continuous pairs use weighted
point-biserial correlations and binary pairs use weighted phi. Ordinal
observed-scale correlations use category scores. The coding/order
affects the estimand and should be stated. effective_n is a
Kish weight diagnostic, not inferential degrees of freedom.
weighting="none" gives equal-weight correlations.
outcome_only weights only pairs involving yi;
this hybrid can produce an indefinite matrix even without missing data.
Differing pairwise missingness can also make a commonly weighted matrix
indefinite. Inspect min_eigenvalue; no automatic repair
occurs.
Latent correlations
latent <- mixed_corr_meta(d,moderators=c("x","binary","ordinal"),
correlation_scale="latent",weighting="inverse_variance",bootstrap=1000,
cluster_id="study",fallback="error",seed=12)Latent polyserial, polychoric and tetrachoric correlations assume underlying Gaussian variables separated by ordered thresholds. Weighted marginal proportions estimate thresholds; a conditional or contingency-table likelihood estimates the correlation. Bivariate-normal rectangle probabilities are integrated numerically. The search range is (-.995,.995); boundary estimates fail. No external correlation package is required.
Latent correlations are not interchangeable with observed-scale
correlations. fallback="error" stops on failed latent point
estimates; fallback="observed" permits explicitly labelled
observed-scale fallback. Sparse categories, category loss during
bootstrap and boundary estimates require investigation. Fallback can mix
estimands, so inspect method labels and bootstrap fallback counts.
WLS path analysis
fit <- path_model(mixed,"yi ~ x+binary+ordinal")
fit$fit_method
#> [1] "wls"
summary(fit)
#> Results generated with MARS:v 0.6.0.8
#> Friday, November 20, 2026
#>
#> Model Type:
#> multivariate
#>
#> Average Correlation Matrix:
#> yi x binary ordinal
#> yi 1.0000000 0.55783036 0.20160803 0.30996922
#> x 0.5578304 1.00000000 0.06952258 0.55268380
#> binary 0.2016080 0.06952258 1.00000000 0.03458148
#> ordinal 0.3099692 0.55268380 0.03458148 1.00000000
#>
#> Synthesis options:
#> method: model
#> transform: none
#> missing_corr: available
#> attenuation: none
#> pd_adjust: none
#> pd_adjusted: FALSE
#> min eigen (before/after): 0.3497 / 0.3497
#> Fit note: Asymptotic WLS chi-square conditional on the matched estimated sampling covariance; RMSEA is unavailable.
#>
#>
#> Model Fitted:
#> yi ~ x+binary+ordinal
#>
#> Fixed Effects:
#> predictor outcome estimate standard_errors test_statistic
#> x -> yi x yi 0.544628794 0.09331681 5.83634159
#> binary -> yi binary yi 0.163629808 0.07501156 2.18139455
#> ordinal -> yi ordinal yi 0.003303147 0.09300930 0.03551416
#> p_value
#> x -> yi 5.335945e-09
#> binary -> yi 2.915425e-02
#> ordinal -> yi 9.716698e-01
#>
#>
#> Fit Statistics:
#> Type Value
#> 1 Model Chi-Square 0 (0)
#> 2 Null Model Chi-Square 195.289 (6)
#> 3 CFI 1
#> 4 TLI <NA>
#> 5 RMSEA <NA>
#> 6 SRMR 0
#> 7 CFI (raw) 1
#> 8 TLI (raw) <NA>The bootstrap covariance matches the selected correlations. WLS uses
it for fitting and expected-information SEs. This full regression is
saturated, so there is no global fit-test p-value. Existing normal
coefficient inference is pointwise and unadjusted. A study-level
num_obs does not substitute for the matched sampling
covariance.
boot <- path_model(mixed,"yi ~ x+binary+ordinal",se_method="bootstrap",
se_draws=100,se_seed=14)
boot$se_diagnostics
#> $method
#> [1] "bootstrap"
#>
#> $requested
#> [1] 100
#>
#> $attempted
#> [1] 100
#>
#> $seed
#> [1] 14
#>
#> $source_bootstrap
#> $source_bootstrap$requested
#> [1] 250
#>
#> $source_bootstrap$accepted
#> [1] 250
#>
#> $source_bootstrap$rejected
#> [1] 0
#>
#> $source_bootstrap$success_rate
#> [1] 1
#>
#> $source_bootstrap$independent_units
#> [1] 120
#>
#> $source_bootstrap$resampling
#> [1] "clusters"
#>
#> $source_bootstrap$fallback_pairs
#> [1] 0
#>
#> $source_bootstrap$sufficient
#> [1] TRUE
#>
#>
#> $accepted
#> [1] 100
#>
#> $rejected
#> [1] 0
#>
#> $repaired
#> [1] 0
#>
#> $sign_aligned
#> [1] 0
#>
#> $failure_counts
#> invalid_correlation repair_failed fit_failed
#> 0 0 0
#> nonfinite_coefficients
#> 0
#>
#> $success_rate
#> [1] 1
#>
#> $minimum_accepted
#> [1] 50
#>
#> $minimum_success_rate
#> [1] 0.8
#>
#> $sufficient
#> [1] TRUEStored correlation draws remain on the raw-r scale.
use_fisher_z=TRUE estimates covariance on Fisher-z scale
and back-transforms it with a delta approximation; FALSE uses empirical
raw-r covariance. The adapter contains no between-study heterogeneity
estimate: bootstrap sampling variance is not Tau.
Independent units and uncertainty
If a study supplies several rows, set cluster_id to
retain those rows together when resampling studies. Without it,
independent rows are assumed. Increasing the number of bootstrap draws
reduces Monte Carlo error, not study dependence.
At least 50 complete draws and an 80 percent success rate are
required before sampling covariance is passed to downstream inference.
The inspectable covariance can still exist when these requirements fail;
bootstrap_diagnostics$sufficient explains its usability.
Path resampling separately checks admissible model fits. Specifying a
seed preserves the caller’s RNG state.
one <- mixed_corr_meta(d,moderators="x",bootstrap=100,seed=12)
one$varcov_matrix
#> x_yi
#> x_yi 0.006270209Constant variables, insufficient complete observations and sparse category support can prevent estimation. Variances must be finite and positive; invalid values are rejected. A single moderator is supported.