con_inadmissible_categorical {dataquieR} | R Documentation |
Detects variable levels not specified in metadata
Description
For each categorical variable, value lists should be defined in the metadata. This implementation will examine, if all observed levels in the study data are valid.
Usage
con_inadmissible_categorical(
resp_vars = NULL,
study_data,
label_col,
item_level = "item_level",
threshold_value = 0,
meta_data = item_level,
meta_data_v2
)
Arguments
resp_vars |
variable list the name of the measurement variables |
study_data |
data.frame the data frame that contains the measurements |
label_col |
variable attribute the name of the column in the metadata with labels of variables |
item_level |
data.frame the data frame that contains metadata attributes of study data |
threshold_value |
numeric from=0 to=100. a numerical value ranging from 0-100. |
meta_data |
data.frame old name for |
meta_data_v2 |
character path to workbook like metadata file, see
|
Details
Algorithm of this implementation:
Remove missing codes from the study data (if defined in the metadata)
Interpretation of variable specific VALUE_LABELS as supplied in the metadata.
Identification of measurements not corresponding to the expected categories. Therefore two output data frames are generated:
on the level of observation to flag each undefined category, and
a summary table for each variable.
Values not corresponding to defined categories are removed in a data frame of modified study data
Value
a list with:
-
SummaryData
: data frame summarizing inadmissible categories with the columns:-
Variables
: variable name/label -
OBSERVED_CATEGORIES
: the categories observed in the study data -
DEFINED_CATEGORIES
: the categories defined in the metadata -
NON_MATCHING
: the categories observed but not defined -
NON_MATCHING_N
: the number of observations with categories not defined -
NON_MATCHING_N_PER_CATEGORY
: the number of observations for each of the unexpected categories
-
-
SummaryTable
: data frame for thedataquieR
pipeline reporting the number and percentage of inadmissible categorical values -
ModifiedStudyData
: study data having inadmissible categories removed -
FlaggedStudyData
: study data having cases with inadmissible categories flagged