APPROACH

Study data

sd1 <- prep_get_data_frame("study_data")

The study data with N = 3000 observations and P = 53 variables have been loaded.

Metadata

prep_load_workbook_like_file("meta_data_v2")
md1 <- prep_get_data_frame("item_level")

The metadata with K = 53 rows related to variables and M = 30 static attributes have been loaded.

APPLICABILITY CHECK

The call of this R-function requires two inputs only. However, if a LABEL column is present in the metadata it is recommended to use these in case VAR_NAMES are not self-explanatory. You can give resp_vars to restrict the checks to a given set of study variables. You can allow a number of failing conversions without the cell becoming red by setting threshold_value to the percentage of failing conversions allowed.

This function only compares the data types of the study data with the declared types from the metadata, so far.

sd1$v00000[5] <- "1,5" # introduce some conversions problem.
sd1$v00003 <- as.character(sd1$v00003) # introduce a problem, than can be fixed
integritymatrix <- int_datatype_matrix(study_data = sd1, meta_data = md1, label_col = LABEL)

Heatmap-like plot:

integritymatrix$SummaryPlot

If the formal threshold_value allows 1% unconvertible mismatches, the one non-convertible entry, the error disappears.

integritymatrix <- int_datatype_matrix(study_data = sd1, meta_data = md1, label_col = LABEL, threshold_value = 1)

Heatmap-like plot:

integritymatrix$SummaryPlot

If STUDY_SEGMENT is defined for all variables, another formal can be used to split the plot.

integritymatrix <- int_datatype_matrix(study_data = sd1, meta_data = md1, label_col = LABEL,
                                       split_segments = TRUE)
integritymatrix$DataTypePlotList
## $INTERVIEW

## 
## $LAB

## 
## $PHYS_EXAM

## 
## $QUESTIONNAIRE

## 
## $STUDY

## 
## attr(,"sizing_hints")
## attr(,"sizing_hints")$figure_type_id
## [1] "dot_mat"
## 
## attr(,"sizing_hints")$rotated
## [1] FALSE
## 
## attr(,"sizing_hints")$number_of_vars
## [1] 5
## 
## attr(,"sizing_hints")$number_of_cat
## [1] 3

Concept relations