invGauss
fits the (randomized drift) inverse Gaussian distribution to survival data. The model is described in Aalen OO, Borgan O, Gjessing HK. Survival and Event History Analysis. A Process Point of View. Springer, 2008. It is based on describing time to event as the barrier hitting time of a Wiener process, where drift towards the barrier has been randomized with a Gaussian distribution. The model allows covariates to influence starting values of the Wiener process and/or average drift towards a barrier, with a user-defined choice of link functions.
invGauss(formula.mu, formula.c = ~1, link.mu = identity,
link.c = exp, data, mu = TRUE, tau = TRUE, verbose = FALSE,
protect = FALSE, opti.method = "BFGS", use.gradient = TRUE,
link.mu.deriv = function(x) 1, link.c.deriv = exp)
Standard survival formula, like formula.mu = Surv(time, status) ~ covar1 + covar2
.
Formula without the left hand side, like formula.c = ~ covar1 + covar2
.
Link function used with formula.mu
. Default is identity
. Note that it should be the function itself, not the name of the function.
Link function used with formula.c
Default is exp
. Note that it should be the function itself, not the name of the function.
Data frame to be used.
If you need to supply your own initial value for mu
. If mu
is numeric, invGauss
will use it as the initial value, otherwise (if mu = TRUE
) it will provide a rough estimate for an initial value.
Like mu
above.
If TRUE, invGauss
prints some information along the way.
Somewhat experimental. If TRUE, possible negative values in the likelihood are "eliminated" to avoid crashes. Probably most useful when link is identity.
invGauss
uses the optimx
package to provide a selection of optimization tools. Default is "BFGS", which calls the optim
function with method = "BFGS"
. The standard optim
default of "Nelder-Mead" seems at times unreliable when used in invGauss
. See the optimx
package documentation for other options.
By default, invGauss
uses analytical gradients in the optimization.
If the user modifies link.mu
and use.gradient = TRUE
, the derivative of the link function must also be supplied. See Details.
If the user modifies link.c
and use.gradient = TRUE
, the derivative of the link function must also be supplied. See Details.
An object of class invGauss
is returned. This is a list, where the most important elements are:
Estimated coefficients
The variance-covariance matrix of the estimated coefficients
The maximized log-likelihood
AIC value
The summary
function provides more details about the result, in particular coefficient values with standard errors, Z statistic, and Wald tests.
(There is also an undocumented invGauss:::predict.invGauss
function, but use it at your own risk...)
For some datasets, invGauss
may have a hard time converging. This may be due to either inappropriate parameter starting values or a hazard shape that is incompatible with the hitting time distribution. Running a simpler model or setting the starting values manually may help. Sometimes, the exact choice of zero on the time scale may be important since some of the model hazards increase steeply immediately after zero. Adding or subtracting a small value from all event/censoring times may help. The new default optimization method "BFGS" seems to do a better job than "Nelder-Mead".
invGauss
uses by default analytical gradients in the optimization, although this does not appear to make much difference. When use.gradient = TRUE
, if the user changes one of the link functions, the corresponding derivative must also be supplied. For instance, if link.mu
is set to exp
, so should link.mu.deriv
. Similarly, if, for instance, link.c
is changed to identity
, then link.c.deriv
should be function(x) 1
.
See web page http://www.uib.no/smis/gjessing/projects/invgauss/ for more details.
Aalen OO, Borgan O, Gjessing HK. Survival and Event History Analysis: A Process Point of View. Springer-Verlag, 2008. Aalen OO and Gjessing HK. Understanding the Shape of the Hazard Rate: A Process Point of View. Statistical Science, 2001, Vol. 1, No. 1, 1-22. Aalen OO. Phase type distributions in survival analysis. Scandinavian Journal of Statistics, 1995, Vol. 22, Issue 4, 447-463. Web Site: http://www.uib.no/smis/gjessing/projects/invgauss/
# NOT RUN {
<!-- %\dontrun{ -->
# }
# NOT RUN {
# Simple run:
data(d.oropha.rec)
res <- invGauss(formula.mu = Surv(time, status) ~ 1, data = d.oropha.rec)
summary(res)
# Use covariates for c, with exponential link function
data(d.oropha.rec)
res <- invGauss(formula.mu = Surv(time, status) ~ 1, formula.c = ~ cond + nstage + tstage,
data = d.oropha.rec) # MODEL 5 (TABLE 10.2, page 412) IN SPRINGER BOOK
summary(res)
# }
# NOT RUN {
<!-- %} -->
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab