Skip to contents

Create a data.frame containing the results of an Observed - Expected Analysis

Usage

createObservedMinusExpectedTable(
  data,
  timeVar,
  eventVar,
  eventArray,
  expectedRate,
  cumulativeVar = CumulativeEvents,
  observedMinusExpectedVar = ObservedMinusExpected,
  indexVar = SubjectIndex,
  statusVar = Status,
  maxTrialSize = NA,
  upperActionLimit = UpperActionLimit,
  lowerActionLimit = LowerActionLimit,
  upperWarningLimit = UpperWarningLimit,
  lowerWarningLimit = LowerWarningLimit,
  warningQuantiles = c(lower = 0.01, upper = 0.99),
  permittedRates = c(lower = 0.05, upper = 0.15)
)

Arguments

data

The input data.frame. Required.

timeVar

The column in data that defines the order in which participants enrolled. Required.

eventVar

The column in data that defines the whether or not a participant experienced an event. Required.

eventArray

An array defining the values of eventVar that indicate that the corresponding participant experienced an event. Required.

expectedRate

A scalar that defines the participant-level event rate that is expected. Required.

cumulativeVar

The name of the column in the output data.frame that contains the cumulative sum of events. Uses tidy evaluation.

observedMinusExpectedVar

The name of the column in the output data.frame that contains the calculated observed - expected statistic for each participant. Uses tidy evaluation.

indexVar

The name of the column in the output data.frame that contains the index of the participant's enrolment: an integer from 1 to n where n is number of participants enrolled. Uses tidy evaluation.

statusVar

The name of the column in the output data.frame that contains the status of the trial: either OK, WARN or BREECH

maxTrialSize

A scalar integer defining the maximum possible size of the trial. Can be NULL.

upperActionLimit

The name of the column in the output data.frame that contains the upper action limit for this participant. Uses tidy evaluation.

lowerActionLimit

The name of the column in the output data.frame that contains the lower action limit for this participant. Uses tidy evaluation.

upperWarningLimit

The name of the column in the output data.frame that contains the upper warning limit for this participant. Uses tidy evaluation.

lowerWarningLimit

The name of the column in the output data.frame that contains the lower warning limit for this participant. Uses tidy evaluation.

warningQuantiles

a named numeric vector of length 2 with elements lower and upper that define the quantiles of the binomial distribution that define the warning limits. Individual elements may be NA. If NULL, lowerWarningLimit and upperWarningLimit are ignored and the corresponding columns are not added to the output data.frame

permittedRates

a named numeric vector of length 2 with elements lower and upper that define the observed event rates that define the action limits. Individual elements may be NA. If NULL, lowerActionLimit and upperActionLimit are ignored and the corresponding columns are not added to the output data.frame