From a6e920917bd262b977d8b1ac5d20bd92424397db Mon Sep 17 00:00:00 2001 From: Carter Thunes Date: Tue, 15 Oct 2024 16:11:52 -0400 Subject: [PATCH 1/2] update mc overwrite of hitc to bool in tcplSubsetChid to actc --- R/tcplSubsetChid.R | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/R/tcplSubsetChid.R b/R/tcplSubsetChid.R index d71365d..f360dd5 100644 --- a/R/tcplSubsetChid.R +++ b/R/tcplSubsetChid.R @@ -92,9 +92,9 @@ tcplSubsetChid <- function(dat, flag = TRUE, type = "mc", export_ready = FALSE) } if (!"casn" %in% names(dat)) dat <- tcplPrepOtpt(dat) # for now we treat all >=.9 hitcall equally - dat[, hitc := hitc >= .9] - dat[, chit := mean(hitc[hitc %in% 0:1]) >= 0.5, by = list(aeid, chid)] - dat <- dat[hitc == chit | (is.na(chit) & (hitc == -1 | is.na(m4id)))] + dat[, actc := hitc >= .9] + dat[, chit := mean(actc[actc %in% 0:1]) >= 0.5, by = list(aeid, chid)] + dat <- dat[actc == chit | (is.na(chit) & (actc == -1 | is.na(m4id)))] dat[, fitc.ordr := NA_integer_] From c8073905805d75dba1ffacf31b34634f67bf5e41 Mon Sep 17 00:00:00 2001 From: Carter Thunes Date: Tue, 15 Oct 2024 16:11:52 -0400 Subject: [PATCH 2/2] update mc overwrite of hitc to bool in tcplSubsetChid to actc --- R/tcplSubsetChid.R | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/R/tcplSubsetChid.R b/R/tcplSubsetChid.R index d71365d..f360dd5 100644 --- a/R/tcplSubsetChid.R +++ b/R/tcplSubsetChid.R @@ -92,9 +92,9 @@ tcplSubsetChid <- function(dat, flag = TRUE, type = "mc", export_ready = FALSE) } if (!"casn" %in% names(dat)) dat <- tcplPrepOtpt(dat) # for now we treat all >=.9 hitcall equally - dat[, hitc := hitc >= .9] - dat[, chit := mean(hitc[hitc %in% 0:1]) >= 0.5, by = list(aeid, chid)] - dat <- dat[hitc == chit | (is.na(chit) & (hitc == -1 | is.na(m4id)))] + dat[, actc := hitc >= .9] + dat[, chit := mean(actc[actc %in% 0:1]) >= 0.5, by = list(aeid, chid)] + dat <- dat[actc == chit | (is.na(chit) & (actc == -1 | is.na(m4id)))] dat[, fitc.ordr := NA_integer_]