inst/docs/about.md

lastdose

User Stories

  1. I am assembling an analysis data set and I wish to include a column that indicates the amount of time since the last dose was administered (TAD).
  2. I am assembling an analysis data set and I wish to include a column that indicates the amount of the last dose that was administered (LDOS).
  3. I would like to calculate TAD or LDOS and get that information back in a format of my choice.
  4. I would like to be able to choose how TAD is filled in for records prior to the first dosing record.

Summary of requirements

  1. The user will pass in NMTRAN-formatted analysis data as a data frame.
  2. The analysis data frame will have the following required columns
    • ID or id - the user id number
    • TIME or time - the time since first observation
    • AMT or amt - the dose amount
    • EVID or evid - the record event id; evid equal to 1 or 4 will be considered dosing records
  3. The analysis data frame will have the following optional columns
    • ADDL or addl - additional doses to administer
    • II or ii - the dosing interval
  4. All required and optional columns must be numeric; an error is generated otherwise.
  5. The following columns must not contain missing values: ID, evid, ii, addl; an error is generated if missing values are found.
  6. When time contains missing values, both TAD and LDOS will be set to missing also.
  7. An error is generated when missing values are found in dosing records (evid 1 or 4) but no error is generated when missing values found in non-dosing records.
  8. The input data set must be sorted by time within individual; an error is generated otherwise.
  9. By default, doses prior to the first dosing record will be calculated as time before the first dose and be expressed as negative numbers.
  10. The user may choose to fill in TAD for records prior to the first dose with a single user-specified fill value.
  11. The single use-specified fill value will be use to fill in all values for TAD when no dosing records are found for a particular individual.
  12. The lastdose() function will append columns called TAD and LDOS to the input data indicating the time after dose and last dose, respectively.
  13. The lastdose_list() function will do the same calculations as lastdose(), however a list with elements tad and ldos will be returned.
  14. The lastdose_df() function will return a data frame with columns tad and ldos with the same definitions as lastdose_list().
  15. The user can choose how to handle TAD when additional doses (via ADDL happen at the same time as another record in the data set. By default, records at the same time are sorted ascending by dose amount so that observation records happen prior to doses. This makes the observation a trough concentration. Alternatively, records can be sorted descending by dose amount so that doses happen first. This makes the observation a peak. The sorting that is done has no bearing on records explicitly listed in the input data.

Coverage

See inst/covr/coverage.md



metrumresearchgroup/lastdose documentation built on April 12, 2025, 3:51 p.m.