bernoulli_ARL_SPRT: Average run length for Bernoulli CUSUM using Integral...

View source: R/bernoulli_ARL.R

bernoulli_ARL_SPRTR Documentation

Average run length for Bernoulli CUSUM using Integral Equation methodology

Description

Internal function that calculates the ARL using the connection between the ARL of a Wald SPRT and a CUSUM.

Usage

bernoulli_ARL_SPRT(h, n_grid, Wncdf, glmmod, theta, theta_true, p0,
  tol = 1e-06)

Arguments

h

Control limit for the Bernoulli CUSUM

n_grid

Number of state spaces used to discretize the outcome space (when method = "MC") or number of grid points used for trapezoidal integration (when method = "SPRT"). Increasing this number improves accuracy, but can also significantly increase computation time.

Wncdf

A function returning the values of the (risk-adjusted) cumulative distribution function (cdf) for the singletons Wn.

glmmod

Generalized linear regression model used for risk-adjustment as produced by the function glm(). Suggested:
glm(as.formula("(survtime <= followup) & (censorid == 1) ~ covariates"), data = data).
Alternatively, a list containing the following elements:

formula:

a formula() in the form ~ covariates;

coefficients:

a named vector specifying risk adjustment coefficients for covariates. Names must be the same as in formula and colnames of data.

theta

The \theta value used to specify the odds ratio e^\theta under the alternative hypothesis. If \theta >= 0, the average run length for the upper one-sided Bernoulli CUSUM will be determined. If \theta < 0, the average run length for the lower one-sided CUSUM will be determined. Note that

p_1 = \frac{p_0 e^\theta}{1-p_0 +p_0 e^\theta}.

theta_true

The true log odds ratio \theta, describing the true increase in failure rate from the null-hypothesis. Default = log(1), indicating no increase in failure rate.

p0

The baseline failure probability at entrytime + followup for individuals.


success documentation built on June 22, 2024, 10:19 a.m.