microcosting_patches_wide: Function to estimate the cost of patches taken (from IPD)

Description Usage Arguments Details Value Examples

View source: R/3c_costing_medication_functions.R

Description

Function to estimate the cost of patches taken (from IPD)

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
microcosting_patches_wide(
  ind_part_data,
  name_med,
  brand_med = NULL,
  dose_med,
  unit_med = NULL,
  no_taken,
  freq_taken,
  timeperiod,
  unit_cost_data,
  unit_cost_column,
  cost_calculated_per,
  strength_column,
  list_of_code_names = NULL,
  list_of_code_freq = NULL,
  list_of_code_dose_unit = NULL,
  list_of_code_brand = NULL,
  eqdose_cov_tab = NULL,
  basis_strength_unit = NULL
)

Arguments

ind_part_data

IPD

name_med

name of medication

brand_med

brand name of medication if revealed

dose_med

dose of medication used

unit_med

unit of medication ; use null if its along with the dose

no_taken

how many taken

freq_taken

frequency of medication

timeperiod

time period for cost calculation

unit_cost_data

unit costs data

unit_cost_column

column name of unit cost in unit_cost_data

cost_calculated_per

column name of unit where the cost is calculated

strength_column

column column name that contain strength of medication

list_of_code_names

if names is coded, give the code:name pairs, optional

list_of_code_freq

if frequency is coded, give the code:frequency pairs, optional

list_of_code_dose_unit

if unit is coded, give the code:unit pairs, optional

list_of_code_brand

if brand names are coded, give the code:brand pairs, optional

eqdose_cov_tab

table to get the conversion factor for equivalent doses, optional

basis_strength_unit

strength unit to be taken as basis required for total medication calculations

Details

Assumes individual level data has name of medication, dose, dose unit, number taken, frequency taken, and basis time Assumes unit cost data contains the name of medication, form/type, strength, unit of strength (or the unit in which the cost calculated), preparation, unit cost, size and size unit (in which name, forms, size, size unit, and preparation are not passed on) @importFrom dplyr %>% a patient use 1 mg/hr patches 5 patches once a week that patch comes in a pack of 4 with cost £2.50 we want to estimate the cost for 3 months that means amount of medication 3 months = 21 weeks number of patches taken = 215 = 105 patches packs = (105/4) almost 27 packs cost = 272.50

Value

the calculated cost of tablets along with original data

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
med_costs_file <- system.file("extdata", "average_unit_costs_med_brand.csv",
package = "packDAMipd")
data_file <- system.file("extdata", "medication.xlsx",
package = "packDAMipd")
ind_part_data <- load_trial_data(data_file)
med_costs <- load_trial_data(med_costs_file)
conv_file <- system.file("extdata", "Med_calc.xlsx", package = "packDAMipd")
table <- load_trial_data(conv_file)
res <- microcosting_patches_wide(
ind_part_data = ind_part_data, name_med = "patch_name",
brand_med = "patch_brand", dose_med = "patch_strength", unit_med = NULL,
no_taken = "patch_no_taken", freq_taken = "patch_frequency",
timeperiod = "4 months", unit_cost_data = med_costs,
unit_cost_column = "UnitCost", cost_calculated_per  = "Basis",
strength_column = "Strength", list_of_code_names = NULL,
list_of_code_freq = NULL, list_of_code_dose_unit = NULL,
list_of_code_brand = NULL, eqdose_cov_tab = table,
basis_strength_unit = "mcg/hr")

packDAMipd documentation built on March 3, 2021, 5:07 p.m.