From a7e43326ac018ad69862175788e2011cd384a740 Mon Sep 17 00:00:00 2001 From: Paul Zivich <32672909+pzivich@users.noreply.github.com> Date: Tue, 22 Aug 2023 14:35:24 -0400 Subject: [PATCH] Fixing updated P-value calculation in R --- BridgeComparisonIntro/R/Chimera.R | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/BridgeComparisonIntro/R/Chimera.R b/BridgeComparisonIntro/R/Chimera.R index e647fbe..a17ae56 100644 --- a/BridgeComparisonIntro/R/Chimera.R +++ b/BridgeComparisonIntro/R/Chimera.R @@ -119,15 +119,7 @@ survival.fusion.ipw <- function(data, treatment, sample, outcome, censor, time, signed=T) # Estimating the area under resamples and re-estimates - # perm_areas = sapply(1:bootstrap_n, - # permute_iteration, - # data=perm_ind, - # time=time, - # sample=sample, - # outcome=outcome, - # treatment=treatment) - # pvalue = mean(ifelse(perm_areas > observed_area, 1, 0)) - var_area_ests = sapply(1:bootstrap_n, + var_area_ests = sapply(1:bootstrap_n, diagnostic_test_iteration, data=data, treatment=treatment, @@ -144,7 +136,7 @@ survival.fusion.ipw <- function(data, treatment, sample, outcome, censor, time, zscore = observed_area / se_area area_lcl = observed_area - 1.96*se_area area_ucl = observed_area + 1.96*se_area - pvalue = pnorm(zscore, mean=0, sd=1, lower.tail=F)*2 + pvalue = 2 * pnorm(abs(zscore), mean=0, sd=1, lower.tail=F) # Displaying diagnostic test based on the IRD results message("====================================================")