knit_print: Render a 'CohortSizeConst' Object

knit_printR Documentation

Render a CohortSizeConst Object

Description

[Experimental]

We provide additional utility functions to allow human-friendly rendition of crmPack objects in Markdown and Quarto files

[Experimental]

[Experimental]

[Experimental]

[Experimental]

[Experimental]

[Experimental]

[Experimental]

[Experimental]

[Experimental]

[Experimental]

[Experimental]

[Experimental]

[Experimental]

[Experimental]

[Experimental]

[Experimental]

[Experimental]

[Experimental]

[Experimental]

[Experimental]

[Experimental]

[Experimental]

[Experimental]

[Experimental]

We provide additional utility functions to allow human-friendly rendition of crmPack objects in Markdown and Quarto files

[Experimental]

[Experimental]

[Experimental]

[Experimental]

[Experimental]

[Experimental]

[Experimental]

[Experimental]

[Experimental]

[Experimental]

[Experimental]

[Experimental]

[Experimental]

[Experimental]

[Experimental]

[Experimental]

[Experimental]

[Experimental]

Usage

## S3 method for class 'CohortSizeConst'
knit_print(x, ..., asis = TRUE, label = c("participant", "participants"))

## S3 method for class 'CohortSizeRange'
knit_print(x, ..., asis = TRUE)

## S3 method for class 'CohortSizeDLT'
knit_print(x, ..., asis = TRUE)

## S3 method for class 'CohortSizeParts'
knit_print(x, ..., asis = TRUE, label = c("participant", "participants"))

## S3 method for class 'CohortSizeMax'
knit_print(x, ..., asis = TRUE)

## S3 method for class 'CohortSizeMin'
knit_print(x, ..., asis = TRUE)

## S3 method for class 'CohortSizeOrdinal'
knit_print(x, ..., asis = TRUE)

## S3 method for class 'GeneralData'
knit_print(
  x,
  ...,
  asis = TRUE,
  labels = c("participant", "participants"),
  full_grid = FALSE,
  summarise = c("none", "dose", "cohort"),
  summarize = summarise,
  units = NA,
  format_func = function(x) x
)

## S3 method for class 'DataParts'
knit_print(
  x,
  ...,
  asis = TRUE,
  labels = c("participant", "participants"),
  full_grid = FALSE,
  summarise = c("none", "dose", "cohort"),
  summarize = summarise,
  units = NA,
  format_func = function(x) x
)

## S3 method for class 'DualEndpoint'
knit_print(
  x,
  ...,
  asis = TRUE,
  use_values = TRUE,
  fmt = "%5.2f",
  units = NA,
  biomarker_name = "a PD biomarker"
)

## S3 method for class 'ModelParamsNormal'
knit_print(
  x,
  use_values = TRUE,
  fmt = "%5.2f",
  params = c("alpha", "beta"),
  preamble = "The prior for θ is given by\\n",
  asis = TRUE,
  theta = "\\theta",
  ...
)

## S3 method for class 'GeneralModel'
knit_print(
  x,
  ...,
  params = c("alpha", "beta"),
  asis = TRUE,
  use_values = TRUE,
  fmt = "%5.2f",
  units = NA
)

## S3 method for class 'LogisticKadane'
knit_print(x, ..., asis = TRUE, use_values = TRUE, fmt = "%5.2f", units = NA)

## S3 method for class 'LogisticKadaneBetaGamma'
knit_print(x, ..., asis = TRUE, use_values = TRUE, fmt = "%5.2f", units = NA)

## S3 method for class 'LogisticLogNormal'
knit_print(
  x,
  ...,
  use_values = TRUE,
  fmt = "%5.2f",
  params = c(`\\alpha` = "alpha", `log(\\beta)` = "beta"),
  preamble = "The prior for θ is given by\\n",
  asis = TRUE
)

## S3 method for class 'LogisticLogNormalMixture'
knit_print(x, ..., asis = TRUE, use_values = TRUE, fmt = "%5.2f", units = NA)

## S3 method for class 'LogisticLogNormalSub'
knit_print(
  x,
  ...,
  use_values = TRUE,
  fmt = "%5.2f",
  params = c(`\\alpha` = "alpha", `log(\\beta)` = "beta"),
  preamble = "The prior for θ is given by\\n",
  asis = TRUE
)

## S3 method for class 'LogisticNormalMixture'
knit_print(x, ..., asis = TRUE, use_values = TRUE, fmt = "%5.2f", units = NA)

## S3 method for class 'LogisticNormalFixedMixture'
knit_print(x, ..., asis = TRUE, use_values = TRUE, fmt = "%5.2f", units = NA)

## S3 method for class 'OneParLogNormalPrior'
knit_print(x, ..., asis = TRUE, use_values = TRUE, fmt = "%5.2f")

## S3 method for class 'OneParExpPrior'
knit_print(x, ..., asis = TRUE)

## S3 method for class 'LogisticLogNormalGrouped'
knit_print(
  x,
  ...,
  use_values = TRUE,
  fmt = "%5.2f",
  params = c(`\\alpha` = "alpha", `\\beta` = "beta", `log(\\delta_0)` = "delta_0",
    `log(\\delta_1)` = "delta_1"),
  preamble = "The prior for θ is given by\\n",
  asis = TRUE
)

## S3 method for class 'LogisticLogNormalOrdinal'
knit_print(
  x,
  ...,
  use_values = TRUE,
  fmt = "%5.2f",
  params = NA,
  preamble = "The prior for θ is given by\\n",
  asis = TRUE
)

## S3 method for class 'IncrementsRelative'
knit_print(x, ..., asis = TRUE)

## S3 method for class 'IncrementsRelativeDLT'
knit_print(x, ..., asis = TRUE)

## S3 method for class 'IncrementsDoseLevels'
knit_print(x, ..., asis = TRUE)

## S3 method for class 'IncrementsHSRBeta'
knit_print(x, ..., asis = TRUE)

## S3 method for class 'IncrementsMin'
knit_print(x, ..., asis = TRUE)

## S3 method for class 'IncrementsOrdinal'
knit_print(x, ..., asis = TRUE)

## S3 method for class 'IncrementsRelativeParts'
knit_print(x, ..., asis = TRUE, labels = c("toxicity", "toxicities"))

## S3 method for class 'IncrementsRelativeDLTCurrent'
knit_print(x, ..., asis = TRUE, labels = c("DLT", "DLTs"))

## S3 method for class 'StoppingOrdinal'
knit_print(x, ..., asis = TRUE)

## S3 method for class 'StoppingMaxGainCIRatio'
knit_print(x, ..., asis = TRUE)

## S3 method for class 'StoppingList'
knit_print(
  x,
  ...,
  preamble =
    "If the result of applying the summary function to the following rules is `TRUE`:\n",
  asis = TRUE
)

## S3 method for class 'StoppingAny'
knit_print(
  x,
  ...,
  preamble = "If any of the following rules are `TRUE`:\n",
  asis = TRUE
)

## S3 method for class 'StoppingAll'
knit_print(
  x,
  ...,
  preamble = "If all of the following rules are `TRUE`:\n",
  asis = TRUE
)

## S3 method for class 'StoppingTDCIRatio'
knit_print(
  x,
  ...,
  dose_label = "the next best dose",
  tox_label = "toxicity",
  fmt_string =
    paste0("%sIf, at %s, the ratio of the upper to the lower limit of the posterior ",
    "95%% credible interval for %s (targetting %2.0f%%) is less than or equal to "),
  asis = TRUE
)

## S3 method for class 'StoppingTargetBiomarker'
knit_print(
  x,
  ...,
  dose_label = "the next best dose",
  biomarker_label = "the target biomarker",
  fmt_string =
    paste0("%sIf, at %s, the posterior probability that %s is in the range ",
    "(%.2f, %.2f)%s is %.0f%% or more."),
  asis = TRUE
)

## S3 method for class 'StoppingLowestDoseHSRBeta'
knit_print(
  x,
  ...,
  tox_label = "toxicity",
  fmt_string =
    paste0("%sIf, using a Hard Stopping Rule with a prior of Beta(%.0f, %.0f), the ",
    "lowest dose in the dose grid has a posterior probability of %s of ",
    "%.0f%% or more."),
  asis = TRUE
)

## S3 method for class 'StoppingMTDCV'
knit_print(
  x,
  ...,
  fmt_string =
    paste0("%sIf the posterior estimate of the robust coefficient of variation of ",
    "the MTD (targetting %2.0f%%), is than or equal to %.0f%%."),
  asis = TRUE
)

## S3 method for class 'StoppingMTDdistribution'
knit_print(
  x,
  ...,
  fmt_string =
    "%sIf the mean posterior probability of %s at %.0f%% of %s is at least %4.2f.",
  dose_label = "the next best dose",
  tox_label = "toxicity",
  asis = TRUE
)

## S3 method for class 'StoppingHighestDose'
knit_print(
  x,
  ...,
  dose_label = "the highest dose in the dose grid",
  asis = TRUE
)

## S3 method for class 'StoppingSpecificDose'
knit_print(x, ..., dose_label = as.character(x@dose), asis = TRUE)

## S3 method for class 'StoppingTargetProb'
knit_print(
  x,
  ...,
  fmt_string =
    "%sIf the probability of %s at %s is in the range [%4.2f, %4.2f] is at least %4.2f.",
  dose_label = "the next best dose",
  tox_label = "toxicity",
  asis = TRUE
)

## S3 method for class 'StoppingMinCohorts'
knit_print(x, ..., asis = TRUE)

## S3 method for class 'StoppingMinPatients'
knit_print(x, ..., label = "participants", asis = TRUE)

## S3 method for class 'StoppingPatientsNearDose'
knit_print(
  x,
  ...,
  dose_label = "the next best dose",
  label = "participants",
  asis = TRUE
)

## S3 method for class 'StoppingCohortsNearDose'
knit_print(x, ..., dose_label = "the next best dose", asis = TRUE)

## S3 method for class 'StoppingMissingDose'
knit_print(x, ..., asis = TRUE)

Arguments

x

(ModelParamsNormal)
the object to be rendered

...

passed to knitr::kable()

asis

(flag)
Not used at present

label

(character)
the term used to label participants

labels

(character)
The word used to describe toxicities. See Usage Notes below.

full_grid

(flag)
Should the full dose grid appear in the output table or simply those doses for whom at least one evaluable participant is available? Ignored unless summarise == "dose".

summarise

(character)
How to summarise the observed data. The default, "none", lists observed data at the participant level. "dose" presents participant counts by dose and "cohort" by cohort.

summarize

(character)
Synonym for summarise

units

(character)
The units in which the values in doseGrid are measured. Appended to each value in doseGrid when knit_printed. The default, NA, omits the units.

format_func

(function)
The function used to format the participant table. The default applies no formatting. Obvious alternatives include kableExtra::kable_styling.

use_values

(flag)
print the values associated with hyperparameters, or the symbols used to define the hyper-parameters. That is, for example, mu or 1.

fmt

(character)
the sprintf format string used to render numerical values. Ignored if use_values is FALSE.

biomarker_name

(character)
A description of the biomarker

params

(character)
The names of the model parameters. See Usage Notes below.

preamble

(character)
the text that introduces the list of rules

theta

(character)
the LaTeX representation of the theta vector

dose_label

(character)
the term used to describe the target dose

tox_label

(character)
the term used to describe toxicity

fmt_string

(character)
the character string that defines the format of the output

biomarker_label

(character)
the term used to describe the biomarker

Value

a character string that represents the object in markdown.

The markdown representation of the object, as a character string

A character string containing a LaTeX rendition of the object.

a character string that represents the object in markdown.

Usage Notes

label describes the trial's participants.

It should be a character vector of length 1 or 2. If of length 2, the first element describes a cohort_size of 1 and the second describes all other cohort_sizes. If of length 1, the character s is appended to the value when cohort_size is not 1.

The default value of col.names is c("Lower", "Upper", "Cohort size") and that of caption is "Defined by the dose to be used in the next cohort". These values can be overridden by passing col.names and caption in the function call.

The by default, the columns are labelled Lower, Upper and ⁠Cohort size⁠. The table's caption is ⁠Defined by the number of DLTs so far observed⁠. These values can be overridden by passing col.names and caption in the function call.

labels describes the trial's participants.

It should be a character vector of length 1 or 2. If of length 2, the first element describes a single participant and the second describes all other situations. If of length 1, the character s is appended to the value when the number of participants is not 1. The default values of col.names and caption vary depending on the summary requested. The default values can be overridden by passing col.names and caption in the function call.

params must be a character vector of length equal to that of x@mean (and x@cov). Its values represent the parameters of the model as entries in the vector theta, on the left-hand side of "~" in the definition of the prior. If named, names should be valid LaTeX, escaped as usual for R character variables. For example, "\\alpha" or "\\beta_0". If unnamed, names are constructed by pre-pending an escaped backslash to each value provided.

The default value of col.names is c("Min", "Max", "Increment") and that of caption is "Defined by highest dose administered so far". These values can be overridden by passing col.names and caption in the function call.

The default value of col.names is c("Min", "Max", "Increment") and that of caption is "Defined by number of DLTs reported so far". These values can be overridden by passing col.names and caption in the function call.

labels defines how toxicities are described.

It should be a character vector of length 1 or 2. If of length 2, the first element describes a single toxicity and the second describes all other toxicity counts. If of length 1, the character s is appended to the value describing a single toxicity.

The default value of col.names is c("Min", "Max", "Increment") and that of caption is "Defined by number of DLTs in the current cohort". These values can be overridden by passing col.names and caption in the function call.

labels defines how toxicities are described.

It should be a character vector of length 1 or 2. If of length 2, the first element describes a single toxicity and the second describes all other toxicity counts. If of length 1, the character s is appended to the value describing a single toxicity.

label describes the trial's participants.

It should be a character vector of length 1 or 2. If of length 2, the first element describes a cohort_size of 1 and the second describes all other cohort_sizes. If of length 1, the character s is appended to the value when cohort_size is not 1.

The default value of col.names is c("Lower", "Upper", "Cohort size") and that of caption is "Defined by the dose to be used in the next cohort". These values can be overridden by passing col.names and caption in the function call.

The by default, the columns are labelled Lower, Upper and ⁠Cohort size⁠. The table's caption is ⁠Defined by the number of DLTs so far observed⁠. These values can be overridden by passing col.names and caption in the function call.

labels describes the trial's participants.

It should be a character vector of length 1 or 2. If of length 2, the first element describes a single participant and the second describes all other situations. If of length 1, the character s is appended to the value when the number of participants is not 1. The default values of col.names and caption vary depending on the summary requested. The default values can be overridden by passing col.names and caption in the function call.

params must be a character vector of length equal to that of x@mean (and x@cov). Its values represent the parameters of the model as entries in the vector theta, on the left-hand side of "~" in the definition of the prior. If named, names should be valid LaTeX, escaped as usual for R character variables. For example, "\\alpha" or "\\beta_0". If unnamed, names are constructed by pre-pending an escaped backslash to each value provided.

The default value of col.names is c("Min", "Max", "Increment") and that of caption is "Defined by highest dose administered so far". These values can be overridden by passing col.names and caption in the function call.

The default value of col.names is c("Min", "Max", "Increment") and that of caption is "Defined by number of DLTs reported so far". These values can be overridden by passing col.names and caption in the function call.

labels defines how toxicities are described.

It should be a character vector of length 1 or 2. If of length 2, the first element describes a single toxicity and the second describes all other toxicity counts. If of length 1, the character s is appended to the value describing a single toxicity.

The default value of col.names is c("Min", "Max", "Increment") and that of caption is "Defined by number of DLTs in the current cohort". These values can be overridden by passing col.names and caption in the function call.

labels defines how toxicities are described.

It should be a character vector of length 1 or 2. If of length 2, the first element describes a single toxicity and the second describes all other toxicity counts. If of length 1, the character s is appended to the value describing a single toxicity.

See Also

knit_print for more details.


Roche/crmPack documentation built on April 30, 2024, 3:19 p.m.