upndown
Validation of input values
validUDinput(cdf, target)checkTarget(target, tname = "Target")
checkCDF(cdf, flatOK = TRUE)
checkNatural(k, parname, toolarge = 1000)
checkDose(x, maxfrac = 0.9)
checkResponse(y)
If a validation issue is found, these functions stop with a relevant error message. If no issue is found, they run through without returning a value.
vector of values, should be nondecreasing between 0 and 1 (inclusive)
numeric value(s), should be between 0 and 1 (exclusive)
logical (checkCDF()
only) if the CDF is completely flat, should function issue a warning (TRUE
, default) - or stop with an error (FALSE
)?
(checkNatural()
only) input number to check whether it's a natural number
string, name of variable to plug in for reporting the error back
(checkNatural()
only) what number would be considered too large to be realistic?
(checkDose()
only) input object to be verified as valid dose values
(checkDose()
only) maximum number of unique values (as fraction of sample size) considered realistic for up-and-down data. Default $0.9n.$ Function also gives a warning if number exceeds $n/2$, since typically this suggests the effective sample size around target is too small.
(checkResponse()
only) input object to be verified as valid response values (`TRUE/FALSE or 0/1)