Skip to contents

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

Value

A data frame that complies with checkMacroFormat

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.

Author

Mike K Smith mstoolkit@googlemail.com

Examples


  # example of micro data with interim
  microData <- get0("microData", envir = asNamespace("MSToolkit"))
#> Error in get0("microData", envir = asNamespace("MSToolkit")): cannot open file 'C:/Users/IYERN03/Documents/R/win-library/4.1/MSToolkit/data/Rdata.rdb': No such file or directory
  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)
#> Warning: restarting interrupted promise evaluation
#> Error in is.data.frame(data): cannot open file 'C:/Users/IYERN03/Documents/R/win-library/4.1/MSToolkit/data/Rdata.rdb': No such file or directory
  stopifnot( nrow(out) == 1 )
#> Error in nrow(out): object 'out' not found