check.data: Function to check the dataset of individuals with (1) and without (0) the
targeted condition.
Description
Function to check the dataset of individuals with (1) and without (0) the
targeted condition.
Usage
check.data(ref, test, model = c("kernel", "binormal", "ordinal", "none"))
Arguments
ref
The reference standard. A column in a data frame or a vector
indicating the classification by the reference test. The reference standard
must be coded either as 0 (absence of the condition) or 1 (presence of the
condition)
test
The index test or test under evaluation. A column in a dataset or
vector indicating the test results.
model
The model used for estimation. Default = 'kernel'. When model is
kernel or binormal, the test data is checked whether the test has a
sufficient number of different values (>= 20). When model is ordinal, the
test data are checked whether they are ordinal or not. When model is 'none'
the test data are only checked for missing data.
Value
Either a valid dataset as data.frame with two variables ref and test
or an error message.
Details
The first check is whether ref and test have equal length. If not,
checkdata is aborted with an error message. The second check is whether ref
is coded solely with 0 and 1. If not, check.data is aborted and an error
message is shown. The third check is whether ref and test have missing
values. If true, list wise deletion is applied and a warning message is
shown. The fourth check is whether test is continuous or not. If test has
less than 20 different values, a warning message is shown. This test is
omitted when ordinal = TRUE.
This function is called internally from every function that requires data.
An external call is only useful to check warnings and errors.