| add_dose | R Documentation |
add_dose() creates drug dose columns in vigibase
datasets (demo, link, adr, drug, ind)
for specified drugs in a dataset. It calculates daily dose values
based on dose amount, frequency, and their corresponding units.
The function is compatible with demo, link, adr, drug and ind
datasets.
add_dose(
.data,
d_code,
d_dose_names = names(d_code),
repbasis = "sci",
method = c("DrecNo", "Record_Id"),
drug_data,
verbose = TRUE
)
.data |
The dataset used to identify individual reports (usually, it is |
d_code |
A named list of drug codes (DrecNos or MPI). See Details. |
d_dose_names |
A character vector. Names for drug dose
columns (must be the same length as d_code), default to |
repbasis |
Suspect, interacting and/or concomitant. Type initial of those you wish to select ("s" for suspect, "c" for concomitant and "i" for interacting ; default to all, e.g. "sci"). |
method |
A character string. The type of drug code (DrecNo or Record_Id). See details. |
drug_data |
A data.frame containing the drug data (usually, it is |
verbose |
Logical, whether to display messages about added doses. |
Actual supported dosage regimens are any combination of:
Kilograms, grams, milligrams, micrograms, nanograms, or picograms
Per minute, hour, day, week, month, or year.
Note that the result will be expressed in milligrams per day, whatever the
aforementioned combination is. This may lead to very small or very large amounts
in drug_dose_mg_per_day columns,
depending on the actual dosage regimen.
The function identifies drug doses in a dataset by cross-referencing
with a drug_data table.
If either the amount unit (grams, etc.) or the frequency (days, etc.) is missing
in drug_data, the corresponding row will be omitted.
Drugs may be filtered based on reputation
bases (suspect, concomitant, or interacting).
Either drug record numbers (e.g., from get_drecno()), or
record_ids (e.g., from get_atc_code()) can be used to
identify drugs. Default method is to DrecNos.
It is very important to check the results, as coding issues are common for dose data, and some results may seem unreliable.
add_drug(), get_drecno(), get_atc_code()
# Example: Adding doses for paracetamol
d_code <- list(paracetamol = c(97818920, 97409107))
demo <-
add_dose(
.data = demo_,
d_code = d_code,
d_dose_names = "paracetamol",
drug_data = drug_
)
desc_cont(demo, "paracetamol_dose_mg_per_day")
# Use only drug dose where paracetamol had a "suspect" reputation base.
demo <-
add_dose(
.data = demo_,
d_code = d_code,
d_dose_names = "para_susp",
repbasis = "s",
drug_data = drug_
)
desc_cont(demo, "para_susp_dose_mg_per_day")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.