Dose Linearity

NCA.jl provides two approaches for assessing dose linearity from NCA results: a power model and a ratio test.

Power Model

NCA.DoseLinearityPowerModel — Type
DoseLinearityPowerModel(df::DataFrame, variable::Symbol; dose = :dose, level = 0.95)

Run a power model to assess dose linearity of variable in NCA output df. The power model is of the form log(variable) ~ log(α) + β × log(dose), where dose names the column of df that holds the dose amounts.

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

julia> using NCA, PharmaDatasets, DataFrames

julia> df = dataset("po_sad_1"); # event-style format with three dose levels

julia> df_r = NCA.read_nca_pumas(df; concentration = :dv, dose = :amt);

julia> report = run_nca(df_r, [:cmax, :tmax]);

julia> DoseLinearityPowerModel(report, :cmax; level = 0.95)
Dose Linearity Power Model
Variable: cmax
Model: log(cmax) ~ log(α) + β × log(dose)
────────────────────────────────────
   Estimate  low CI 95%  high CI 95%
────────────────────────────────────
β  0.972438     0.41523      1.52965
────────────────────────────────────

Predictions

StatsAPI.predict — Function
predict(d::NCA.DoseLinearityPowerModel, xs::Vector; level = nothing, interval = :confidence)

Predict the response of a power model d for the given vector xs of doses. The level argument sets the confidence interval level for the prediction. If level is not provided, the level used to fit the model is used. The interval argument can be set to :confidence or :prediction. The :confidence interval is the default and provides a confidence interval for the mean response. The :prediction interval provides a prediction interval for a new response.

predict(
  model::AbstractPumasModel,
  subject::Subject,
  param::NamedTuple,
  [randeffs,];
  [obstimes::AbstractVector,
  diffeq_options::NamedTuple]
)::Union{SubjectPrediction,Vector{SubjectPrediction}}

Compute population and individual predictions for the single subject based on model and the population parameters param. A NamedTuple of random effects, randeffs, can be omitted or provided by the user. If they are omitted, they will be estimated from the data in the subject.

If the optional obstimes argument is passed then the time points in obstimes and the time points of the observations of the subject are used for the predictions. Otherwise, only the time points of the observations of the subject are used for the predictions.

The function allows for extra keyword arguments to be passed on to the differential equations solver through the diffeq_options keyword. See the online documentation for more details.

predict(
  model::AbstractPumasModel,
  population::Population,
  param::NamedTuple,
  [vrandeffs,];
  [obstimes::AbstractVector,
  diffeq_options::NamedTuple]
)::Union{SubjectPrediction,Vector{SubjectPrediction}}

Compute population and individual predictions for either the single subject or vector of subjects (Population) population based on model and the population parameters param. Optionally, random effects can be passed as a Vector of NamedTuples where the ith element is used for the individual predictions of the ith subject.

If omitted, the empirical bayes estimates given the input param will be calculated if the input subjects have observations. If any subject does not have any observations, the mode of the domain-transformed prior will be used.

If the optional obstimes argument is passed then the time points in obstimes and the time points of the observations of the subject are used for the predictions. Otherwise, only the time points of the observations of the subject are used for the predictions.

The function allows for extra keyword arguments to be passed on to the differential equations solver through the diffeq_options keyword. See the online documentation for more details.

predict(
  fpm::AbstractFittedPumasModel,
  [population::Union{Subject,Population}];
  [obstimes::AbstractVector]
)::Union{SubjectPrediction,Vector{SubjectPrediction}}

Compute population and individual predictions for the fitted model fpm. By default, the predictions are computed for the estimation data but the predictions can also be computed for user supplied data by passing either a single subject or a vector of subjects (Population) as the population argument.

If the optional obstimes argument is passed then the time points in obstimes and the time points of the observations of the subject are used for the predictions. Otherwise, only the time points of the observations of the subject are used for the predictions.

Any optional keyword arguments used when fitting fpm are reused when computing the predictions.

Ratio Test

NCA.DoseLinearityRatioTest — Type
DoseLinearityRatioTest(df::DataFrame, variable::Symbol; dose = :dose, level = 0.95)

Run ratio tests to assess dose linearity for variable in NCA output df. 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

julia> using NCA, PharmaDatasets, DataFrames

julia> df = dataset("po_sad_1"); # event-style format with three dose levels

julia> df_r = NCA.read_nca_pumas(df; concentration = :dv, dose = :amt);

julia> report = run_nca(df_r, [:cmax, :tmax]);

julia> DoseLinearityRatioTest(report, :cmax; level = 0.90)
Dose linearity pairwise ratio test
Variable: cmax
───────────────────────────────────────────────────
           Ratio  Estimate  low CI 90%  high CI 90%
───────────────────────────────────────────────────
60 vs. 30    2.0   1.82231     1.06322      3.12336
90 vs. 30    3.0   2.95197     1.5536       5.60899
───────────────────────────────────────────────────