Skip to contents

Extract the statistical summary generated by calcu for classified data

Usage

bind_cut_cate(
  gt_table_body,
  group_list,
  merge_subgroup_name = NULL,
  ppop = NULL
)

Arguments

gt_table_body

result of calcu calculation.

group_list

need to provide a specified column name, which is usually a basic diagnosis or drug list.

merge_subgroup_name

default is NULL.Need to provide the specified column name, which is generally the collective term of basic diagnosis or basic drugs.If this parameter provides a non-NULL character, then group_ list will be regarded as a subset of the diagnosis or drug, and its corresponding percentage will also be used as the denominator.

ppop

default is NULL. gt_table_body come from a subset of the total population? If you need to calculate the statistics of the subset in the total population, please provide a total population.

Value

A structured data set.A structured dataset. Contains the number and proportion
of subsets after the classification of classified variables.

Note

When the parameter ppop is provided, only the parameter ppop is used by default to calculate the group_list. So please redesign the running rules, or use ? bind_cut_ cate to view the internal build logic of the function to redesign the code.

Examples

if (FALSE) {
data(data_med)
diags = data_med$diag
aim_select = c("patient_id","visit_id","diag_union")

diag_wider = wider_clean(diags,aim_select)

diag_wider_calcu = diag_wider %>% select(!"patient_id") %>%
  dplyr::mutate("vascular disease" =1) %>% calcu(.)

group_list = c("Dyslipidemia","high blood pressure","myocardial infarction")
merge_subgroup_name = "vascular disease"
#'
bind_cut_cate(diag_wider_calcu,group_list,merge_subgroup_name)
bind_cut_cate(diag_wider_calcu,group_list,ppop=1000)
}