system_nca_summary: Summarize NCA Results in Tabular Format

View source: R/ubiquity.r

system_nca_summaryR Documentation

Summarize NCA Results in Tabular Format

Description

Creates tabular summaries of NCA results

Usage

system_nca_summary(
  cfg,
  analysis_name = "analysis",
  treat_as_factor = c("ID", "Dose_Number", "Dose"),
  params_include = c("ID", "cmax", "tmax", "auclast"),
  params_header = NULL,
  rptname = "default",
  label_format = NULL,
  summary_stats = NULL,
  summary_labels = list(MEAN = "Mean", STD = "Std Dev", MEDIAN = "Median", N = "N obs",
    SE = "Std Err."),
  summary_location = NULL,
  ds_wrangle = NULL,
  digits = 3,
  table_theme = "theme_zebra"
)

Arguments

cfg

ubiquity system object

analysis_name

string containing the name of the analysis (default 'analysis') that was previously run

treat_as_factor

sequence of column names to be treated as factors (default c("ID", "Dose_Number", "Dose")). Use this to report values without added decimals.

params_include

vector with names of parameters to include (default c("ID", "cmax", "tmax", "auclast"))

params_header

list with names of parameters followed by a vector of headers. You can use the placeholder "<label>" to include the standard label (e.g. list(cmax=c("<label>", "(ng/ml)"))), with a default of NULL.

rptname

report name (either PowerPoint or Word) that this table will be used in ("default")

label_format

string containing the format in which headers and labels are being specified, either "text", or "md" (default NULL assumes "text" format)

summary_stats

list with strings as names containing placeholders for summary statistics and the values indicate the parameters to apply those statistics to. for example, if you want to calculate mean and standard deviation of AUClast you could use list("<MEAN> (<STD>)"=c("auclast"). This would create a row at the bottom of the table with this information for just the listed parameters. To split this up across two rows just do the following: list("<MEAN>"=c("auclast"), "<STD>"=c("auclast")). Any NA values will be ignored when calculating statistics. The allowed summary statistics are the mean (<MEAN>), median (<MEDIAN>), standard deviation (<STD>), standard error (<SE>), and the number of observations used to calculate statistics. (<N>). The default value of NULL prevents any summary statistics from being included.

summary_labels

list containing the mapping of summary statistics defined by summary_stats with their text labels in the output tables:

list(MEAN   = "Mean", 
     STD    = "Std Dev", 
     MEDIAN = "Median", 
     N      = "N obs", 
     SE     = "Std Err.")
summary_location

column where to put the labels (e.g. Mean (Std)) for summary statistic. The default (NULL) will leave these labels off. If you set this to the "ID" column it will put them under the subject IDs.

ds_wrangle
 ds_wrangle = list(Dose=c(30), Dose_Number = c(1))
digits

number of significant digits to report (3) or NULL to prevent rounding

table_theme

flextable theme see the flextable package for available themes, and set to NULL to prevent themes from being applied. (default="theme_zebra")

Value

list with the following elements

  • isgood Boolean variable indicating success (TRUE) or failure (FALSE) if the call is successful the following will be defined (NULL

  • nca_summary dataframe containing the summary table with headers and any summary statistics appended to the bottom

  • nca_summary_ft same information in the nca_summary ouput as a flextable object

  • components list with the elements of the summary table each as dataframes (header, data, and summary)

See Also

Vignette on NCA (vignette("NCA", package = "ubiquity"))


ubiquity documentation built on May 29, 2024, 12:02 p.m.