validUDinput: Data Validation Utilities for 'upndown'

View source: R/genutils.r

validUDinputR Documentation

Data Validation Utilities for upndown

Description

Validation of input values

Usage

validUDinput(cdf, target)

checkTarget(target, tname = "Target")

checkCDF(cdf, flatOK = TRUE)

checkNatural(k, parname, toolarge = 1000)

checkDose(x, maxfrac = 0.9)

checkResponse(y)

Arguments

cdf

vector of values, should be nondecreasing between 0 and 1 (inclusive)

target

numeric value(s), should be between 0 and 1 (exclusive)

flatOK

logical (checkCDF() only) if the CDF is completely flat, should function issue a warning (TRUE, default) - or stop with an error (FALSE)?

k

(checkNatural() only) input number to check whether it's a natural number

parname, tname

string, name of variable to plug in for reporting the error back

toolarge

(checkNatural() only) what number would be considered too large to be realistic?

x

(checkDose() only) input object to be verified as valid dose values

maxfrac

(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.

y

(checkResponse() only) input object to be verified as valid response values ('TRUE/FALSE or 0/1)

Value

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.


upndown documentation built on April 3, 2025, 10:57 p.m.