Learn R Programming

anoint (version 1.4)

data.anoint: Generate a clinical trial data set under a specified multiple interaction model

Description

Returns a simulated equal-allocation, parallel-group clinical trial with possibly multiple interactions among prognostic factors.

Usage

data.anoint(alpha, beta, gamma, mean, vcov, n=100, event=.8, type = c("binomial","survival"))

Arguments

alpha
vector specifying control and treatment group intercept
beta
vector specifying prognostic factor main effects
gamma
vector specifying modification of prognostic effects in the presence of treatment
mean
vector of covariate mean to be supplied to mvrnorm of the MASS package.
vcov
matrix of variance-covariance matrix of prognostic covariates to be supplied to mvrnorm
n
number of subjects in each treatment arm
event
proportion of observed events when type is "survival"
type
string indicating type of response variable

Value

Data frame with y, trt, and V1,...,VK prognostic factors. The data frame also has event with a time-to-event reponse, which is an indicator for an observed event.

Details

When type is "survival", the parameters specify the log-rate for an exponentially distributed random variable. Censored times are non-informatively right-censored. When type is "binomial", the parameters specify a log-odds model.

Examples

Run this code

null.interaction <- data.anoint(
                             alpha = c(log(.2/.8),log(.2*.75/(1-.2*.75))),
                             beta = c(1.5,2),
                             gamma = rep(1,2),
                             mean = c(0,0),
                             vcov = diag(2),
                             type="binomial"
                             )

fit <- glm(y~(.)*trt,data=null.interaction,family="binomial")

summary(fit)


null.interaction <- data.anoint(
                             alpha = c(log(.5),log(.5*.75)),
                             beta = c(1.5,2),
                             gamma = rep(1,2),
                             mean = c(0,0),
                             vcov = diag(2),
                             type="survival",
                             event = .7
                             )

fit <- coxph(Surv(y, event)~(.)*trt,data=null.interaction)

summary(fit)

Run the code above in your browser using DataLab