Check sum variables
check_sum_vars.Rd
This function checks whether the sum of selected variables are equal to another.
Arguments
- ...
character vector. This character vector contains the name of the variables of which the sum will be checked.
- df
a dataframe.
- outcome
character string. Name of variable of the dataframe which should equal the sum of variables mentioned in `...`.
- digits
Define the number of digits at which the sum and the `outcome` variables are rounded.
Examples
# Checking whether health state and adverse event costs of the intervention equal the total discounted costs
check_sum_vars("t_costs_pfs_d_int", "t_costs_pd_d_int", "t_costs_ae_int",
df = head(df_pa),
outcome = "t_costs_d_int",
digits = 0)
#> [1] "Sums of t_costs_pfs_d_int, t_costs_pd_d_int, t_costs_ae_int variables equal t_costs_d_int variabe"