USEPA / CompTox-ToxCast-tcplFit2

Performs basic concentration response curve fitting
https://cran.r-project.org/package=tcplfit2
Other
1 stars 0 forks source link

Add to the tcplfit2 vignette how you can "censor" the BMD #46

Closed sedavid01 closed 8 months ago

sedavid01 commented 9 months ago

There are options in the tcplhit2_core function that allow individuals to "censor" the BMD when it occurs above or below an experimental dose that is specified or some other specified value. Users need to know (a) that this function is able to do this, (b) demonstrate how to do this, and (c) provide some context as to why a user may want to do this in an analysis.

Goal: Convey to users how to "censor" estimated BMD values based on provided BMD allowable boundaries.

Please make sure to provide commentary, code of how users can utilize this function, and visuals of how it works.

sedavid01 commented 9 months ago

@gracezhihuizhao in tcplhit2_core there are options to "censor" BMD values (see internal code below).

@param bmd_low_bnd Multiplier for bmd lower bound. A value of .1 would require the bmd to be no lower #' than 1/10th of the lowest concentration tested. #' @param bmd_up_bnd Multiplier for the bmd upper bound. A value of 10 would require the bmd to be no lower #' than 10 times the highest concentration tested.

Lines 170-194: # apply bmd min if(!is.null(bmd_low_bnd) & !is.na(bmd)){ min_conc <- min(conc) min_bmd <- min_conc*bmd_low_bnd if(bmd < min_bmd){ bmd_diff <- min_bmd - bmd #shift all bmd to the right bmd <- bmd + bmd_diff bmdl <- bmdl + bmd_diff bmdu <- bmdu + bmd_diff } }

# apply bmd max if(!is.null(bmd_up_bnd) & !is.na(bmd)){ max_conc <- max(conc) max_bmd <- max_conc*bmd_up_bnd if(bmd > max_bmd){ #shift all bmd to the left bmd_diff <- bmd - max_bmd bmd <- bmd - bmd_diff bmdl <- bmdl - bmd_diff bmdu <- bmdu - bmd_diff } }

sedavid01 commented 8 months ago

The pull request for this ticket was approved and branched merged to 'dev'. Marking this task/issue as done.