prep_min_obs_level: Support function to identify the levels of a process variable...

View source: R/prep_min_obs_level.R

prep_min_obs_levelR Documentation

Support function to identify the levels of a process variable with minimum number of observations


utility function to subset data based on minimum number of observation per level


prep_min_obs_level(study_data, group_vars, min_obs_in_subgroup)



data.frame the data frame that contains the measurements


variable list the name grouping variable


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.


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.


a data frame with:

  • a subsample of original data

dataquieR documentation built on Nov. 16, 2022, 5:10 p.m.