costing_opioid_liquids_averageMED_wide {packDAMipd}R Documentation

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

Description

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

Usage

costing_opioid_liquids_averageMED_wide(
  ind_part_data,
  name_med,
  brand_med = NULL,
  bottle_size,
  bottle_size_unit = NULL,
  bottle_lasts,
  bottle_lasts_unit = NULL,
  preparation_dose,
  preparation_unit = NULL,
  timeperiod,
  unit_cost_data,
  unit_cost_column,
  cost_calculated_per,
  strength_column,
  list_of_code_names = NULL,
  list_of_code_brand = NULL,
  list_of_code_bottle_size_unit = NULL,
  list_of_code_bottle_lasts_unit = NULL,
  list_preparation_dose_unit = NULL,
  eqdose_covtab = NULL,
  basis_strength_unit = NULL
)

Arguments

ind_part_data

IPD

name_med

name of medication

brand_med

brand name of medication if revealed

bottle_size

size of the bottle used

bottle_size_unit

unit of bottle volume

bottle_lasts

how long the bottle lasted

bottle_lasts_unit

time unit of how long the bottle lasted

preparation_dose

dose if preparation is given

preparation_unit

unit of preparation dose

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 has strength of medication

list_of_code_names

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

list_of_code_brand

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

list_of_code_bottle_size_unit

list of bottle size units and codes

list_of_code_bottle_lasts_unit

list of time of bottle lasts and codes

list_preparation_dose_unit

list of preparation dose units and codes

eqdose_covtab

table to get the conversion factor for equivalent doses, optional, but the column names have to unique Similar to c("Drug", "form", "unit", "factor") or c("Drug", "form", "unit", "conversion")

basis_strength_unit

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

Value

the calculated cost of tablets along with original data

Examples

med_costs_file <- system.file("extdata", "medicaton_costs_all.xlsx",
package = "packDAMipd")
data_file <- system.file("extdata", "medication_liq.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_liquids_wide(
ind_part_data = ind_part_data, name_med = "liq_name", brand_med =  NULL,
dose_med = "liq_strength", unit_med = NULL, bottle_size = "liq_bottle_size",
bottle_size_unit = NULL, bottle_lasts = "liq_lasts",
bottle_lasts_unit = NULL, preparation_dose = NULL, preparation_unit = NULL,
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_brand = NULL, list_of_code_dose_unit = NULL,
list_of_code_bottle_size_unit = NULL, list_of_code_bottle_lasts_unit = NULL,
list_preparation_dose_unit = NULL, eqdose_covtab = table,
basis_strength_unit = NULL)

[Package packDAMipd version 1.1.0 Index]