View source: R/prep_min_obs_level.R
prep_min_obs_level | R Documentation |
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)
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. |
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.