testset | R Documentation |
A table of dosage texts with gold standard interpretation, used for testing the algorithm.
data(testset)
A data frame with the following 12 variables.
textid
numeric; text identifier
order
numeric; order of dose line (a single dosage text can generate more than one dose line)
text
character; the dosage text
qty
numeric; quantity per dose
units
character; dose units
freq
numeric; dose frequency
tot
numeric; total dose per time period
max
factor with 3 levels: max, average, exact
time
numeric; time interval in number of days
change
factor with 4 levels: first, second, nochange, combined
choice
factor with 3 levels: choice, asneeded, nochoice
duration
numeric; duration of prescription
daily_dose
numeric; dose units per day
Shah AD, Martinez C. An algorithm to derive a numerical daily dose from unstructured text dosage instructions. Pharmacoepidemiol Drug Saf 2006; 15(3): 161-166. doi: 10.1002/pds.1151 http://onlinelibrary.wiley.com/doi/10.1002/pds.1151/
testdoseconvert
, lookups
# Import the testset table
data("testset")
# Analyse the testset
results <- testdoseconvert(goldstandard = testset)
# Check there are no incorrect results
if (any(results$outcome == 'actual')){
print(results[outcome == 'actual' | outcome == 'intended'])
stop('\nError in analysis of test set.\n')
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.