Learn R Programming

crmPack (version 2.2.1)

tidy: Tidying CrmPackClass objects

Description

[Experimental]

In the spirit of the broom package, provide a method to convert a CrmPackClass object to a (list of) tibbles.

Following the principles of the broom package, convert a CrmPackClass object to a (list of) tibbles. This is a basic, default representation.

[Experimental]

A method that tidies a GeneralData object.

[Experimental]

A method that tidies a Data object.

[Experimental]

A method that tidies a DataGrouped object.

[Experimental]

A method that tidies a DataDA object.

[Experimental]

A method that tidies a DataDual object.

[Experimental]

A method that tidies a DataParts object.

[Experimental]

A method that tidies a DataMixture object.

[Experimental]

A method that tidies a DataOrdinal object.

[Experimental]

A method that tidies a DataCombo object.

[Experimental]

A method that tidies a HierarchicalData object.

[Experimental]

A method that tidies a HierarchicalModel object.

[Experimental]

A method that tidies a LogisticIndepBeta object.

[Experimental]

A method that tidies a Effloglog object.

Usage

tidy(x, ...)

# S4 method for CrmPackClass tidy(x, ...)

# S4 method for GeneralData tidy(x, ...)

# S4 method for Data tidy(x, ...)

# S4 method for DataGrouped tidy(x, ...)

# S4 method for DataDA tidy(x, ...)

# S4 method for DataDual tidy(x, ...)

# S4 method for DataParts tidy(x, ...)

# S4 method for DataMixture tidy(x, ...)

# S4 method for DataOrdinal tidy(x, ...)

# S4 method for DataCombo tidy(x, ...)

# S4 method for HierarchicalData tidy(x, ...)

# S4 method for Simulations tidy(x, ...)

# S4 method for ComboSimulations tidy(x, ...)

# S4 method for HierarchicalSimulations tidy(x, ...)

# S4 method for HierarchicalModel tidy(x, ...)

# S4 method for LogisticIndepBeta tidy(x, ...)

# S4 method for Effloglog tidy(x, ...)

# S4 method for IncrementsMaxToxProb tidy(x, ...)

# S4 method for IncrementsRelative tidy(x, ...)

# S4 method for CohortSizeDLT tidy(x, ...)

# S4 method for CohortSizeMin tidy(x, ...)

# S4 method for CohortSizeMax tidy(x, ...)

# S4 method for CohortSizeRange tidy(x, ...)

# S4 method for CohortSizeParts tidy(x, ...)

# S4 method for IncrementsMin tidy(x, ...)

# S4 method for IncrementsRelative tidy(x, ...)

# S4 method for IncrementsRelativeDLT tidy(x, ...)

# S4 method for IncrementsRelativeParts tidy(x, ...)

# S4 method for NextBestNCRM tidy(x, ...)

# S4 method for NextBestNCRMLoss tidy(x, ...)

# S4 method for DualDesign tidy(x, ...)

# S4 method for DesignCombo tidy(x, ...)

# S4 method for HierarchicalDesign tidy(x, ...)

# S4 method for ArmConditionList tidy(x, ...)

# S4 method for DesignArm tidy(x, ...)

# S4 method for Samples tidy(x, ...)

# S4 method for HierarchicalSamples tidy(x, ...)

Value

A (list of) tibble(s) representing the object in tidy form.

The tibble object.

The tibble object.

The tibble object.

The tibble object.

The tibble object.

The tibble object.

The tibble object.

The tibble object.

The tibble object.

The tibble object.

The list of tibble objects.

The list of tibble objects.

The list of tibble objects.

Arguments

x

(CrmPackClass)
the object to be tidied.

...

potentially used by class-specific methods.

Usage Notes

The prior observations are indicated by a Cohort value of 0 in the returned tibble.

Examples

Run this code
CohortSizeConst(3) %>% tidy()
.DefaultData() %>% tidy()
.DefaultDataOrdinal() %>% tidy()
.DefaultDataGrouped() %>% tidy()
.DefaultDataDA() %>% tidy()
# Create a sample Data object
sample_data <- Data(
  x = c(0.1, 0.5, 1.5, 3, 6, 10, 10, 10),
  y = c(0, 0, 0, 0, 0, 0, 1, 0),
  cohort = c(1, 2, 3, 4, 5, 6, 6, 6),
  doseGrid = c(0.1, 0.5, 1.5, 3, 6, seq(from = 10, to = 80, by = 2)),
  response = c(0, 0, 0, 0, 0, 1, NA, NA),
  backfilled = c(FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE)
)

# Tidy the Data object
tidied_data <- tidy(sample_data)

# Print the tidied data
print(tidied_data)
.DefaultData() %>% tidy()
.DefaultDataOrdinal() %>% tidy()
.DefaultDataGrouped() %>% tidy()
.DefaultDataDA() %>% tidy()
.DefaultData() %>% tidy()
.DefaultDataOrdinal() %>% tidy()
.DefaultDataGrouped() %>% tidy()
.DefaultDataDA() %>% tidy()
.DefaultData() %>% tidy()
.DefaultDataOrdinal() %>% tidy()
.DefaultDataGrouped() %>% tidy()
.DefaultDataDA() %>% tidy()
.DefaultData() %>% tidy()
.DefaultDataOrdinal() %>% tidy()
.DefaultDataGrouped() %>% tidy()
.DefaultDataDA() %>% tidy()
.DefaultData() %>% tidy()
.DefaultDataOrdinal() %>% tidy()
.DefaultDataGrouped() %>% tidy()
.DefaultDataDA() %>% tidy()
.DefaultData() %>% tidy()
.DefaultDataOrdinal() %>% tidy()
.DefaultDataGrouped() %>% tidy()
.DefaultDataDA() %>% tidy()
.DefaultSimulations() %>% tidy()
.DefaultLogisticIndepBeta() %>% tidy()
.DefaultEffloglog() %>% tidy()
IncrementsMaxToxProb(prob = c("DLAE" = 0.2, "CRS" = 0.05)) %>% tidy()
CohortSizeRange(intervals = c(0, 20), cohort_size = c(1, 3)) %>% tidy()
.DefaultCohortSizeDLT() %>% tidy()
.DefaultCohortSizeMin() %>% tidy()
.DefaultCohortSizeMax() %>% tidy()
.DefaultCohortSizeRange() %>% tidy()
CohortSizeParts(cohort_sizes = c(1, 3)) %>% tidy()
.DefaultIncrementsMin() %>% tidy()
CohortSizeRange(intervals = c(0, 20), cohort_size = c(1, 3)) %>% tidy()
x <- .DefaultIncrementsRelativeDLT()
x %>% tidy()
.DefaultIncrementsRelativeParts() %>% tidy()
NextBestNCRM(
  target = c(0.2, 0.35),
  overdose = c(0.35, 1),
  max_overdose_prob = 0.25
) %>%
  tidy()
.DefaultNextBestNCRMLoss() %>% tidy()
.DefaultDualDesign() %>% tidy()
options <- McmcOptions(
  burnin = 100,
  step = 1,
  samples = 2000
)

emptydata <- Data(doseGrid = c(1, 3, 5, 10, 15, 20, 25, 40, 50, 80, 100))

model <- LogisticLogNormal(
  mean = c(-0.85, 1),
  cov = matrix(c(1, -0.5, -0.5, 1), nrow = 2),
  ref_dose = 56
)

samples <- mcmc(emptydata, model, options)
samples %>% tidy()

Run the code above in your browser using DataLab