validate_datalong {rbmi} | R Documentation |
Validate a longdata object
Description
Validate a longdata object
Usage
validate_datalong(data, vars)
validate_datalong_varExists(data, vars)
validate_datalong_types(data, vars)
validate_datalong_notMissing(data, vars)
validate_datalong_complete(data, vars)
validate_datalong_unifromStrata(data, vars)
validate_dataice(data, data_ice, vars, update = FALSE)
Arguments
data |
a |
vars |
a |
data_ice |
a |
update |
logical, indicates if the ICE data is being set for the first time or if an update is being applied |
Details
These functions are used to validate various different parts of the longdata object
to be used in draws()
, impute()
, analyse()
and pool()
. In particular:
validate_datalong_varExists - Checks that each variable listed in
vars
actually exists in thedata
validate_datalong_types - Checks that the types of each key variable is as expected i.e. that visit is a factor variable
validate_datalong_notMissing - Checks that none of the key variables (except the outcome variable) contain any missing values
validate_datalong_complete - Checks that
data
is complete i.e. there is 1 row for each subject * visit combination. e.g. thatnrow(data) == length(unique(subjects)) * length(unique(visits))
validate_datalong_unifromStrata - Checks to make sure that any variables listed as stratification variables do not vary over time. e.g. that subjects don't switch between stratification groups.