This function calculates various summary statistics for formatted output of PKNCA::pk.nca().

calculate_summary_stats(res_pknca, input_groups = "DOSNO")

Arguments

res_pknca

A data frame containing results of Non Compartmental Analysis using PKNCA package

input_groups

A character vector specifying the columns to group by. Here. the hierachrical order matters

Value

A data frame with summary statistics for each group and parameter.

Details

The function calculates the following statistics for numeric variables:

  • Geometric mean (geomean)

  • Geometric coefficient of variation (geocv)

  • Arithmetic mean (mean)

  • Coefficient of variation (CV)

  • Standard deviation (sd)

  • Minimum value (min)

  • Maximum value (max)

  • Median value (median)

  • Count (count)

The function excludes the columns ANALYTE, DOSEA, PCSPEC, STUDYID, and USUBJID from the numeric summarization because they are possible grouping variables The resulting summary statistics are rounded to three decimal places.

Examples

if (FALSE) { # \dontrun{
data <- data.frame(
  STUDYID = rep(1, 10),
  USUBJID = rep(1:2, each = 5),
  DOSEA = rep(c(10, 20), each = 5),
  ANALYTE = rep(c("A", "B"), each = 5),
  PCSPEC = rep(c("X", "Y"), each = 5),
  VALUE = rnorm(10)
)
input_groups <- c("STUDYID", "USUBJID", "DOSEA", "ANALYTE", "PCSPEC")
calculate_summary_stats(data, input_groups)
} # }