Skip to contents

Create an Observed Over Expected Grid

Using the work of Katz et al (1978) calculate acceptable limits for the ratio of two binomial proportions. The Type 1 error rate can be specified, and the limits can be one- or two-sided.

Usage

createObservedOverExpectedTable(
  observedData = NULL,
  observedRate = NULL,
  n = NObserved,
  nHistorical,
  nObservedRange = seq(50, 1500, 25),
  expectedRate,
  historicalRate,
  alpha = 0.05,
  sides = c("two", "lower", "upper")
)

Arguments

observedData

a tibble containing the observed data that will be compared to the calculated limit(s). May be NULL.

observedRate

The column in observedData that contains the observed rates. Ignored if observedData is NULL. Uses tidy evaluation.

n

The column in both observedData (if not NULL) and the output tibble that defines the sample size to which the corresponding limit(s) relate(s).

nHistorical

the number of observations on which the historical rate is based

nObservedRange

a sequence of values for which limits should be calculated

expectedRate

the event rate expected in the current study. Usually the same as historicalRate, but need not be so.

historicalRate

the event rate observed in the historical data

alpha

The Type 1 error rate associated with the calculated limits. Default 0.05

sides

the sidedness of alpha. Either two, upper or lower. Default two.

Value

a tibble