# NCA Docstrings

NCA.DoseLinearityPowerModelMethod
DoseLinearityPowerModel(nca::NCA.NCAReport, variable::Symbol; level = 0.95)

Run a power model to assess dose linearity of variable in NCAReport nca. The power model is of the form log(variable) ~ log(α) + β × log(dose).

The fitted parameters can be assessed by showing the model or running StatsBase.coeftable(model).

The confidence interval level can be set using level.

Example

DoseLinearityPowerModel(ncareport, :cmax; level = 0.9)
NCA.DoseLinearityRatioTestMethod
DoseLinearityRatioTest(nca::NCA.NCAReport, variable::Symbol; level = 0.95)

Run ratio tests to assess dose linearity for variable in NCAReport nca. The test runs HypothesisTests.EqualVarianceTTests on the log transform of variable. This effectively tests the difference of geometric means between two doses. The groups in each TTest are the low dose and one of each of the remaining dose groups. A confidence interval level for the difference of the means of the log transformed data can be set using level.

The result can be inspected by showing the returned object or using StatsBase.coeftable(model). The real dose ratio can be compared with the estimated ratio and its confidence interval, where these values are re-transformed from the TTest output using exp.

Example

DoseLinearityRatioTest(ncareport, :cmax; level = 0.9)
NCA.NCADoseType
NCADose

NCADose takes the following arguments

• time: time of the dose
• amt: The amount of dosage
• route: Type of route, NCA.IVBolus, NCA.IVInfusion or NCA.EV
• ii: interdose interval
• ss: steady-state
NCA.NCASubjectMethod
NCASubject(conc, time; start_time=nothing, nominal_time=nothing, end_time=nothing, volume=nothing, concu=true, timeu=true, volumeu=true,
id="1", group=nothing, dose=nothing, llq=nothing,
lambdaz=nothing, clean=true, check=true, lambdazslopetimes = nothing, lambdazidxs = nothing, num_blqs_df = 0,  kwargs...)

Constructs a NCASubject

Note that llq keyword argument still takes effects with the presence of the blq data column, and llq defaults to 0.

Setting clean=false disables all checks on conc and time to remove the cost of checking and cleaning data. It should only be used when the data is for sure "clean".

NCA.read_ncaFunction
read_nca(file::AbstractString; kwargs...)
read_nca(df_obs::AbstractDataFrame, df_dose::AbstractDataFrame; id = :id, time = :time, kwargs...)
read_nca(df::DataFrame; id=:id, time=:time, observations=:conc, nominal_time = :nominal_time,
start_time=:start_time, end_time=:end_time, volume=:volume,
amt=:amt, route=:route, duration=:duration, blq=:blq,
ii=:ii, ss=:ss, group=nothing, concu=true, timeu=true, amtu=true, volumeu=true,
verbose=true, lambdazidxs = nothing, lambdazslopetimes = nothing, sparse = false, kwargs...)

Parse a DataFrame object or a CSV file to NCAPopulation. NCAPopulation holds an array of NCASubjects which contain relevant data for the individual subjects.

Remark

Concentrations at dosing rows are NOT ignored in read_nca.

• df : DataFrame containing the data for the analysis.

2 dataframes, in order, observations dataframe and dosing dataframe, can be passed to read_nca as well, rest of the arguments stay consistent in this case.

The following keyword arguments are used to specify column names in the df:

• id : The numeric or string id of the subject. Defaults to :id.
• time : The actual time at which the observations were measured. Defaults to :time.
• observations: The observation (e.g. concentration) time series measurements. Values must be numbers or missing. Defaults to :conc.
• amt: The amount of a dose. Can either be the dosing amount at each dosing time and otherwise missing or the dosing amount is present at each time, in this case the first time (for a subject in a subgroup) is considered as the dosing time. Defaults to :amt.
• route: The route of administration. Possible choices are iv for intravenous, ev for extravascular, and inf for infusion. These can be specified as lower, upper or mixed case. E.g. iv, IV or Ev are accepted. Defaults to :route.
• duration: The infusion duration. Should be the duration value or missing. Defaults to :duration.
• blq: Below the lower Limit of Quantification (BLQ). Used to specify the observation is BLQ. The BLQ column can take a value of 1 for BLQ observation and 0 otherwise. Defaults to :blq.
• ii: The interdose interval, equivalent to tau. Used to specify the interval length for steady-state dosing. Defaults to the :ii column. If specified, and ss is true, then analysis returns steady-state parameters e.g., cminss, cavgss, cmaxss by computing the accumulationindex.
• ss: The steady-state. Used to specify whether a dose is steady-state, a steady-state dose takes the value 1 and 0 otherwise. It defaults to the :ss column. If ss is set to 1 for a subject, ii should be greater than 0.
• group: The columns to group the data by, splits the subjects based on the group information associated with them. Defaults to no grouping.
• llq: The Lower Limit of Quantification (LLQ). Defaults to nothing.
• concblq: The scheme for handling of BLQ values. Defaults to the dictionary Dict(:first=>:keep, :middle=>:drop, :last=>:keep), further explanation is available in the Handling BLQ Data section.
• concu: The units for observations (e.g. concentration). Defaults to no units.
• amtu: The units for dosing amount. Defaults to no units.
• timeu: The units for time. Defaults to no units.
• volumeu: The units for volume. Defaults to no units.
• verbose: When true, warnings will be thrown when the output does not match PumasNCADF. Defaults to true.
• nominal_time: The nominal time corresponding to the observations. Defaults to :nominal_time.
• sparse: Boolean flag to indicate if the dataset should be treated as a case of sparse sampling. Defaults to false.

Urine analysis requires the following columns not used in case of plasma.

• start_time : The beginning of the urine collection time. Defaults to :start_time.
• end_time : The end of the urine collection time. Defaults to :end_time.
• volume: Collected urine volume. Defaults to :volume.

For details about the handling of concentration values below the lower limit of quantification, please check out the documentation of NCA.cleanblq. All the keyword arguments of NCA.cleanblq are applicable to read_nca, too.

NCA.run_ncaMethod
  run_nca(pop::NCAPopulation;
parameters = nothing,
studyid::String="",
studytitle::String="",
author=[],
date::DateTime=Dates.now(),
conclabel::String="",
timelabel::String="",
grouplabels::Array=String[],
groupsizes::NamedTuple=NamedTuple(),
versionnumber::Union{String, VersionNumber}=v"0.1",
sigdigits=nothing,
kwargs...)

The primary function in NCA.jl, to run NCA analysis on a population. Returns a NCAReport object that has a data frame of parameters computed in the analysis and other metadata information passed when run_nca is called.

NCA.showunitsMethod
showunits(nca:NCASubject[, indent])

Prints the units of concentration, time, auc, aumc, λz, and dose for nca. The optional argument indent adds indent number of spaces to the left of the list.

NCA.summarizeMethod
  summarize(data::AbstractDataFrame;
stratify_by::AbstractVector{<:Union{Symbol,Integer,AbstractString}} = Symbol[],
parameters::AbstractVector{<:Union{Symbol,Integer,AbstractString}} = [:cmax, :tmax, :half_life, :aucinf_obs, :auclast, :cl, :vz],
stats::AbstractVector{<:Function} = [numsamples, extrema, mean, std, geomean, geostd, geomeanCV])

Computes summary statistics specified by stats kwarg for parameters obtained from NCA analysis with run_nca. stratify_by allows you to group your computations.