anoint | R Documentation |
Prepares formula and data to be used in methods with the analysis of interactions class.
anoint(formula,data,family="binomial",select=NULL,nfolds=10,
type.measure="deviance",keep.vars=NULL,na.action=na.omit,...)
formula |
analysis of interaction formula for |
data |
data.frame containing the variables of |
family |
character specifying family of |
select |
character for type of selection to perform, either " |
nfolds |
number of folds used in cross-validation to find lasso penalty parameter when |
type.measure |
loss to use for cross-validation. Used only when |
keep.vars |
vector of names of variables to retain if selection procedure is used. Used only when |
na.action |
function, na.action to perform for handling observations with missing variables among variables in formula. Default is |
... |
additional arguments passed to |
To test proportional multiple interactions between treatment variable indicator z
(binary, 0 or 1) and variables a
, b
, with response y
of a GLM model, formula
must be y~(a+b)*z
. If a Cox model with event time time
and event indicator event
, formula
is Surv(time,event)~(a+b)*z
.
Factors should not be included as a
or b
because this could change how the reference group is represented in the model. Separate 0/1 dummy variables must be supplied by the user.
When select
is glmnet
a Lasso method (cv.glmnet
) is used to select prognostic factors using 10-fold cross-validation with the control data only. If select
is set to stepAIC a stepwise selection procedure is used with specifications based on arguments passed to ...
.
Returns instance of anoint
class.
Stephanie Kovalchik <s.a.kovalchik@gmail.com>
Follmann DA, Proschan MA. A multivariate test of interaction for use in clinical trials. Biometrics 1999; 55(4):1151-1155
data.anoint,cv.glmnet
# NO INTERACTION CONDITION, LOGISTIC MODEL
null.interaction <- data.anoint(
alpha = c(log(.5),log(.5*.75)),
beta = log(c(1.5,2)),
gamma = rep(1,2),
mean = c(0,0),
vcov = diag(2),
type="survival", n = 500
)
head(null.interaction)
object <- anoint(Surv(y, event)~(V1+V2)*trt,data=null.interaction,family="coxph")
object
summary(object)
# NO INTERACTION CONDITION, WITH PROGNOSTIC SELECTION
null.interaction <- data.anoint(
alpha = c(log(.2/.8),log(.2*.75/(1-.2*.75))),
beta = c(1.5,2,0,0),
gamma = rep(1,4),
mean = rep(0,4),
vcov = diag(4),
type="binomial", n = 500
)
head(null.interaction)
object <- anoint(y~(V1+V2+V3+V4)*trt,data=null.interaction,select="glmnet")
summary(object)
# FORCE V1, V2 INTO THE MODEL; INTERCEPT IS ALWAYS THE FIRST TERM OF MODEL
object <- anoint(y~(V1+V2+V3+V4)*trt,data=null.interaction,
select="glmnet",keep.vars=c("V1","V2"))
summary(object)
# SELECTION WITH STEPWISE SELECTION AND AIC CRITERION
object <- anoint(y~(V1+V2+V3+V4)*trt,data=null.interaction,
select="stepAIC")
summary(object)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.