CUSUM for paired binary data as described in Steiner et al. (1999).

## Usage

pairedbinCUSUM(stsObj, control = list(range=NULL,theta0,theta1,
h1,h2,h11,h22))
pairedbinCUSUM.runlength(p,w1,w2,h1,h2,h11,h22, sparse=FALSE)

## Arguments

stsObj

Object of class sts containing the paired responses for each of the, say n, patients. The observed slot of stsObj is thus a $$n \times 2$$ matrix.

control

Control object as a list containing several parameters.

range

Vector of indices in the observed slot to monitor.

theta0

In-control parameters of the paired binary CUSUM.

theta1

Out-of-control parameters of the paired binary CUSUM.

h1

Primary control limit (=threshold) of 1st CUSUM.

h2

Primary control limit (=threshold) of 2nd CUSUM.

h11

Secondary limit for 1st CUSUM.

h22

Secondary limit for 2nd CUSUM.

p

Vector giving the probability of the four different possible states, i.e. c((death=0,near-miss=0),(death=1,near-miss=0), (death=0,near-miss=1),(death=1,near-miss=1)).

w1

The parameters w1 and w2 are the sample weights vectors for the two CUSUMs, see eqn. (2) in the paper. We have that w1 is equal to deaths

w2

As for w1

h1

decision barrier for 1st individual cusums

h2

decision barrier for 2nd cusums

h11

together with h22 this makes up the joing decision barriers

h22

together with h11 this makes up the joing decision barriers

sparse

Boolean indicating whether to use sparse matrix computations from the Matrix library (usually much faster!). Default: FALSE.

## Details

For details about the method see the Steiner et al. (1999) reference listed below. Basically, two individual CUSUMs are run each based on a logistic regression model. The combined CUSUM not only signals if one of its two individual CUSUMs signals, but also if the two CUSUMs simultaneously cross the secondary limits.

categoricalCUSUM
An sts object with observed, alarm, etc. slots trimmed to the control\$range indices.