prep_min_obs_level {dataquieR} | R Documentation |
Support function to identify the levels of a process variable with minimum number of observations
Description
utility function to subset data based on minimum number of observation per level
Usage
prep_min_obs_level(study_data, group_vars, min_obs_in_subgroup)
Arguments
study_data |
data.frame the data frame that contains the measurements |
group_vars |
variable list the name grouping variable |
min_obs_in_subgroup |
integer optional argument if a "group_var" is used. This argument specifies the minimum no. of observations that is required to include a subgroup (level) of the "group_var" in the analysis. Subgroups with less observations are excluded. The default is 30. |
Details
This functions removes observations having less than min_obs_in_subgroup
distinct values in a group variable, e.g. blood pressure measurements
performed by an examiner having less than e.g. 50 measurements done. It
displays a warning, if samples/rows are removed and returns the modified
study data frame.
Value
a data frame with:
a subsample of original data