From 75b9958401aebd594acd55c5bb9e248e35193fb6 Mon Sep 17 00:00:00 2001 From: hanneoberman Date: Fri, 18 Oct 2024 14:41:10 +0200 Subject: [PATCH] change difference plot to imp-obs (instead of obs-imp) --- R/plot_corr.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/plot_corr.R b/R/plot_corr.R index 0772afc..44a001b 100644 --- a/R/plot_corr.R +++ b/R/plot_corr.R @@ -87,7 +87,7 @@ plot_corr <- if (diff) { lab_fill <- "Difference in correlations* " - lab_note <- "*observed minus imputed (pooled across imputations)" + lab_note <- "*pooled imputed minus observed" } # compute correlations if (!imp | diff) { @@ -99,7 +99,7 @@ plot_corr <- stats::cov2cor(stats::cov(data.matrix(.x[, vrb_matched]), use = "pairwise.complete.obs")) }) if (diff) { - corr <- corr - (Reduce("+", corrs) / length(corrs)) + corr <- (Reduce("+", corrs) / length(corrs)) - corr } else { corr <- Reduce("+", corrs) / length(corrs) }