aftfit: Instrumental variable estimation via semiparametric...

Description Usage Arguments Examples

View source: R/aftfit.R

Description

Fitting function for instrumental variable estimation under the semiparametric AFT model

Usage

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, ...)

Arguments

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 Surv() function.

data

a data.frame which contains the variables named in the formula.

instrument

a vector of length equal to the number of rows in data containing the instrumental variable

confounded.x.names

name of the exposure variable (endogenous variable) of interest

method

one of:

  • "AFT-IPCW" The proposed IV method that uses inverse probability of censoring weighting

  • "AFT" Plain rank-based AFT method that does not account for unmeasured confounding

  • "AFT-IV" biased AFT method that acccounts for unmeasured confounding, but not the non-ignorable censoring (and is hence biased)

  • "AFT-2SLS" Two-stage AFT method which accounts for unmeasured confounding but requires correct specification of relationship between IV and exposure

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. "ls" uses the LS method of Zeng and Lin (2008), "sv" uses the SV method of Zeng and Lin (2008). "full.bootstrap" uses a full boostrap where resampled estimating equations are solved for each iteration (this method is very slow!)

B

number of bootstrap iterations

dependent.censoring

for the "AFT-IPCW" method, should the censoring model allow for dependence on covariates? If TRUE a Cox model will be fit for the censoring distribution

na.action

how should missing data be treated? See help file for lm for more details

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 BB algorithm

verbose

should messages be printed? logical variable

BB.control

control list for BBsolve() function. See BBsolve for more information

...

not used

Examples

 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)

jaredhuling/aftiv documentation built on May 20, 2019, 9:55 a.m.