Skip to content

Commit

Permalink
Merge pull request #302 from USEPA/189-tcplsubsetchid-overwrites-hitc…
Browse files Browse the repository at this point in the history
…-to-boolean

update mc overwrite of hitc to bool in tcplSubsetChid to actc
  • Loading branch information
cthunes authored Oct 16, 2024
2 parents b5868f9 + 7ccfede commit ceacf6a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions R/tcplSubsetChid.R
Original file line number Diff line number Diff line change
Expand Up @@ -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_]
Expand Down

0 comments on commit ceacf6a

Please sign in to comment.