macroEvaluation: Macro Evaluation

macroEvaluationR Documentation

Macro Evaluation

Description

The macro evaluation gives a short summary of all analysis performed for a single replicate of data.

Usage

macroEvaluation(
  data,
  macroCode,
  interimCol = getEctdColName("Interim"),
  doseCol = getEctdColName("Dose")
)

Arguments

data

(Required) Data set to use, typically returned from a micro evaluation step.

macroCode

(Required) Function used to summarize the micro data. If the function has arguments "doseCol" and/or "interimCol", the arguments to macroEvaluation are passed to it in addition to the data

interimCol

(Optional) Name of the interim column, should be a valid name ("INTERIM" by default). See validNames

doseCol

(Optional) Name of the dose column, should be a valid name ("DOSE" by default). See validNames

Details

The macro code is first studied to make sure that it is a function that takes a data argument. The code is then executed against the micro data, and should produce a data frame containing a single row. This is further checked using the checkMacroFormat function.

Value

A data frame that complies with checkMacroFormat

Author(s)

Mike K Smith mstoolkit@googlemail.com

Examples


  # example of micro data with interim
  microData <- get0("microData", envir = asNamespace("MSToolkit"))
  mCode <- function(data) {
    diffMeans <- data$MEAN[data$DOSE == 100 & data$INTERIM == 0] -
    data$MEAN[data$DOSE == 0 & data$INTERIM == 0]
    data.frame(SUCCESS = diffMeans > 10, NFINAL = sum(data$N))
  }
  out <- macroEvaluation(microData, mCode)
  stopifnot( nrow(out) == 1 )


MikeKSmith/MSToolkit documentation built on Feb. 15, 2024, 5:32 p.m.