Quick ggplot2 barchart visualization of partially observed/missing variables
smdi_vis.Rd
This function takes a dataframe and outputs a nicely formatted ggplot2 vertical barchart plot that visualizes the proportion missing for a given variable (vector) or all existent missing variables. Results can also be stratified by another variable in which case the proportion missing refers to the amount of patients in the respective stratum.
Important: Function assumes the data is in a one-row-per-patient format.
Arguments
- data
dataframe or tibble object with partially observed/missing variables. Assumes a a one-row-per-patient format
- covar
character covariate or covariate vector with partially observed variable/column name(s) to investigate. If NULL, the function automatically includes all columns with at least one missing observation
- strata
character name of variable/column by which results should be stratified