Description Usage Arguments Examples
Fitting function for instrumental variable estimation under the semiparametric AFT model
1 2 3 4 5 6 | aftfit(formula, data, instrument, confounded.x.names, method = c("AFT",
"AFT-IV", "AFT-2SLS", "AFT-IPCW"), smoothed = FALSE, weights = NULL,
bootstrap = FALSE, boot.method = c("ls", "sv", "full.bootstrap"),
B = 1000L, dependent.censoring = FALSE, na.action, init = NULL,
return.data = FALSE, tol = 1e-05, maxit = 10L, verbose = 0,
BB.control = NULL, ...)
|
formula |
a formula object, with the response on the left of a tilde operator, and the covariates.
The response must be a survival object as returned by the |
data |
a |
instrument |
a vector of length equal to the number of rows in |
confounded.x.names |
name of the exposure variable (endogenous variable) of interest |
method |
one of:
|
smoothed |
should a smoothed version of the estimating equation be used? Experimental. |
weights |
observation weights. Not used currently! |
bootstrap |
logical variable indicating whether or not to run bootstrap |
boot.method |
bootstrap method to use. |
B |
number of bootstrap iterations |
dependent.censoring |
for the |
na.action |
how should missing data be treated? See help file for |
init |
vector equal to the length of the number of parameters in the model used to initialize estimation |
return.data |
should the data be returned? |
tol |
positive tolerance threshold. Smaller values indicate more precise solutions are required |
maxit |
maximum number of restarts for |
verbose |
should messages be printed? logical variable |
BB.control |
control list for |
... |
not used |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | library(aftiv)
set.seed(1)
true.beta <- c(1,-0.5,-0.5,0.25,0,0,-0.75,0.75)
dat <- simIVMultivarSurvivalData(500,1,1,-1,1,true.beta,num.confounded = 1,
confounding.function = "exp")
df <- data.frame(dat$survival[c("delta", "log.t")], dat$X)
Z <- dat$Z
system.time(aftf <- aftfit(Surv(log.t, delta) ~ ., data = df,
instrument = Z,
confounded.x.names = "X1",
method = c("AFT", "AFT-IV", "AFT-2SLS", "AFT-IPCW"),
boot.method = "ls", verbose = 1,
B = 200L, smoothed = FALSE,
bootstrap = TRUE))
summary(aftf)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.