hist_start {hctrial}R Documentation

Initializes a design based on historical controls before the start of the study.

Description

Initializes a design based on historical controls before the start of the study.

Usage

hist_start(hist_data, formula, phi = "odds_ratio", c1, modelfit = NULL,
  mean0 = NULL, mean1 = NULL, alpha = 0.05, beta = 0.2)

Arguments

hist_data

A data frame containing covariates and binary responses for historical controls.

formula

A formula which is used for fitting a logistic regression model on the historical data.

phi

The relation between the response rate under the null and the response rate under the interesting alternative. "odds_ratio" assumes that the odds ratio (OR) between these response rates is constant with OR = c1+1. "difference" assumes that the response rate under the alternative is c1 higher than under the null. Can also be specified by the user by providing a function with arguments c and x.

c1

parameter for obtaining the response rate under the alternative, see description of phi.

modelfit

Can be used instead of formula and hist_data to provide an arbitrary fitted model that is compatible with predict(modelfit, type="response"). formula and hist_data are ignored if modelfit is specified.

mean0

Optional: Can be used to overwrite the estimated average response rate under the null of the fitted model.

mean1

Optional: Can be used to overwrite the estimated average response rate under the alternative of the fitted model.

alpha

Specified type I error of the trial.

beta

Specified type II error of the trial.

Value

A list returning the arguments of the function and the preliminary design for starting the stratified trial.

Examples

X <- abs(rnorm(1000, 0, 1))
Y <- rbinom(1000, 1, 1-exp(-X))
mydata <- data.frame("X" = X, "Y" = Y)
hist_start(mydata, Y~X, c1 = 2)

[Package hctrial version 0.1.0 Index]