Skip to contents

Calculate the number and proportion of patients

Usage

pop_perc(numerator_data, denominator_data, patient_id = NULL, ifunite = FALSE)

Arguments

numerator_data

a dataframe subset

denominator_data

a complete set of data, or a number used to represent

patient_id

This function uses patient_ id by default to calculate the number of patients. If the column name of the patient ID is not patient_ id in the patient_ data, you need to use patient_ id as a parameter to specify the patient ID column. In addition, when denominator_data is also a dataframe, the patient ID column names in denominator_data and numerator_data are required to be the same.

ifunite

default FALSE.when ifunite = TRUE,return a character contain count_patient_num(proportion of patients).

Value

The number and proportion of patients

Examples

data(data_med)
pat_small = data_med$pat %>% calcu_age(.,birthdate) %>% dplyr::as_tibble(.) %>%  filter("age">30)
#> Warning: Today's time is being used to calculate the patient's age.
pat_table = data_med$pat
pop_perc(pat_small,1000)
#> There is an error in the internal function.
#>           Please check the relevant parameter settings according to the description.
#> NULL