`R/aftgee.R`

`aftgee.Rd`

Fits a semiparametric accelerated failure time (AFT) model with least-squares approach. Generalized estimating equation is generalized to multivariate AFT modeling to account for multivariate dependence through working correlation structures to improve efficiency.

```
aftgee(
formula,
data,
subset,
id = NULL,
contrasts = NULL,
weights = NULL,
margin = NULL,
corstr = "independence",
binit = "srrgehan",
B = 100,
control = aftgee.control()
)
```

- formula
a formula expression, of the form

`response ~ predictors`

. The`response`

is a`Surv`

object with right censoring. In the case of no censoring,`aftgee`

will return an ordinary least estimate when`corstr = "independence"`

. See the documentation of`lm`

,`coxph`

and`formula`

for details.- data
an optional data.frame in which to interpret the variables occurring in the

`formula`

.- subset
an optional vector specifying a subset of observations to be used in the fitting process.

- id
an optional vector used to identify the clusters. If missing, then each individual row of

`data`

is presumed to represent a distinct subject. The length of`id`

should be the same as the number of observations.- contrasts
an optional list.

- weights
an optional vector of observation weights.

- margin
a

`sformula`

vector; default at 1.- corstr
a character string specifying the correlation structure. The following are permitted:

`independence`

`exchangeable`

`ar1`

`unstructured`

`userdefined`

`fixed`

- binit
an optional vector can be either a numeric vector or a character string specifying the initial slope estimator.

When

`binit`

is a vector, its length should be the same as the dimension of covariates.When

`binit`

is a character string, it should be either`lm`

for simple linear regression, or`srrgehan`

for smoothed Gehan weight estimator.

The default value is "srrgehan".

- B
a numeric value specifies the resampling number. When B = 0, only the beta estimate will be displayed.

- control
controls maxiter and tolerance.

An object of class "`aftgee`

" representing the fit.
The `aftgee`

object is a list containing at least the following components:

- coefficients
a vector of initial value and a vector of point estimates

- coef.res
a vector of point estimates

- var.res
estimated covariance matrix

- coef.init
a vector of initial value

- var.init.mat
estimated initial covariance matrix

- binit
a character string specifying the initial estimator.

- conv
An integer code indicating type of convergence after GEE iteration. 0 indicates successful convergence; 1 indicates that the iteration limit

`maxit`

has been reached- ini.conv
An integer code indicating type of convergence for initial value. 0 indicates successful convergence; 1 indicates that the iteration limit

`maxit`

has been reached- conv.step
An integer code indicating the step until convergence

Chiou, S., Kim, J. and Yan, J. (2014) Marginal Semiparametric Multivariate
Accelerated Failure Time Model with Generalized Estimating Equation.
*Lifetime Data Analysis*, **20**(4): 599--618.

Jin, Z. and Lin, D. Y. and Ying, Z. (2006)
On Least-squares Regression with Censored Data. *Biometrika*, **90**, 341--353.

```
## Simulate data from an AFT model with possible depended response
datgen <- function(n = 100, tau = 0.3, dim = 2) {
x1 <- rbinom(dim * n, 1, 0.5)
x2 <- rnorm(dim * n)
e <- c(t(exp(MASS::mvrnorm(n = n, mu = rep(0, dim), Sigma = tau + (1 - tau) * diag(dim)))))
tt <- exp(2 + x1 + x2 + e)
cen <- runif(n, 0, 100)
data.frame(Time = pmin(tt, cen), status = 1 * (tt < cen),
x1 = x1, x2 = x2, id = rep(1:n, each = dim))
}
set.seed(1); dat <- datgen(n = 50, dim = 2)
fm <- Surv(Time, status) ~ x1 + x2
summary(aftgee(fm, data = dat, id = id, corstr = "ind", B = 8))
#> Call:
#> aftgee(formula = fm, data = dat, id = id, corstr = "ind", B = 8)
#>
#> AFTGEE Estimator
#> Estimate StdErr z.value p.value
#> (Intercept) 3.344 0.255 13.103 < 2.2e-16 ***
#> x1 0.844 0.242 3.494 < 2.2e-16 ***
#> x2 0.979 0.081 12.104 < 2.2e-16 ***
#> ---
#> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
summary(aftgee(fm, data = dat, id = id, corstr = "ex", B = 8))
#> Call:
#> aftgee(formula = fm, data = dat, id = id, corstr = "ex", B = 8)
#>
#> AFTGEE Estimator
#> Estimate StdErr z.value p.value
#> (Intercept) 3.326 0.139 23.972 < 2.2e-16 ***
#> x1 0.872 0.139 6.264 < 2.2e-16 ***
#> x2 0.961 0.189 5.078 < 2.2e-16 ***
#> ---
#> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
```