Calculate the number and proportion of patients
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 notpatient_ id
in thepatient_ data
, you need to usepatient_ 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
.whenifunite = TRUE
,return a character containcount_patient_num(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