Learn R Programming

timereg (version 1.3-6)

aalen.test: Fit additive hazards model

Description

Fits both the additive hazards model of Aalen and the semi-parametric additive hazards model of McKeague and Sasieni. Estimates are un-weighted. Time dependent variables and counting process data (multiple events per subject) are possible.

Resampling is used for computing p-values for tests of time-varying effects.

The modelling formula uses the standard survival modelling given in the survival package.

Usage

aalen.test(formula,data=sys.parent(),start.time=0,max.time=NULL,robust=1,
id=NULL,clusters=NULL,residuals=0,n.sim=1000,weighted.test=0,
covariance=0,resample.iid=0,weights=0,offsets=0,fix.gam=0,pseudo.score=0,
approx = "dt", gamma = 0,silent=0)

Arguments

formula
a formula object with the response on the left of a '~' operator, and the independent terms on the right as regressors. The response must be a survival object as returned by the `Surv' function. Time-invariant regressors are specified by the w
data
a data.frame with the variables.
start.time
start of observation period where estimates are computed.
max.time
end of observation period where estimates are computed. Estimates thus computed from [start.time, max.time]. Default is max of data.
robust
to compute robust variances and construct processes for resampling. May be set to 0 to save memory.
id
For timevarying covariates the variable must associate each record with the id of a subject.
clusters
cluster variable for computation of robust variances.
n.sim
number of simulations in resampling.
weighted.test
to compute a variance weighted version of the test-processes used for testing time-varying effects.
residuals
to returns residuals that can be used for model validation in the function cum.residuals
covariance
to compute covariance estimates for nonparametric terms rather than just the variances.
resample.iid
to return i.i.d. representation for nonparametric and parametric terms.
offsets
fixed intensity only works for semiparametric, model but fully non-parametric model can be fitted by using fix.gam option, see also example.
weights
weights for estimation.
fix.gam
keep gamma parameter fixed.
pseudo.score
number of simulation for pseudo-score test. If pseudo.score=0 it is not computed. The pseudo-score test for fixed effects appears to be superior to other tests computed.

The semiparametric model is given as $$\lambda(t) = Y_i(t) ( X_i^t \beta(t) + Z_i

approx
describes how the integrals are approximated, "dt" is default and uses a piececonstant approximation for all time points both censoring and event tiems, "death-times" uses only the event times for the approximation.
gamma
values for potential fixed gamma coefficients.
silent
set to 1 to avoid printing of warnings for non-inverible design-matrices for different timepoints, default is 0.

Value

  • returns an object of type "aalen". With the following arguments:
  • cumcumulative timevarying regression coefficient estimates are computed within the estimation interval.
  • var.cumthe martingale based pointwise variance estimates for cumulatives.
  • robvar.cumrobust pointwise variances estimates for cumulatives.
  • gammaestimate of parametric components of model.
  • var.gammavariance for gamma.
  • robvar.gammarobust variance for gamma.
  • residualslist with residuals. Estimated martingale increments (dM) and corresponding time vector (time).
  • obs.testBeq0observed absolute value of supremum of cumulative components scaled with the variance.
  • pval.testBeq0p-value for covariate effects based on supremum test.
  • sim.testBeq0resampled supremum values.
  • obs.testBeqCobserved absolute value of supremum of difference between observed cumulative process and estimate under null of constant effect.
  • pval.testBeqCp-value based on resampling.
  • sim.testBeqCresampled supremum values.
  • obs.testBeqC.isobserved integrated squared differences between observed cumulative and estimate under null of constant effect.
  • pval.testBeqC.isp-value based on resampling.
  • sim.testBeqC.isresampled supremum values.
  • conf.bandresampling based constant to construct robust 95% uniform confidence bands.
  • test.procBeqCobserved test-process of difference between observed cumulative process and estimate under null of constant effect over time.
  • sim.test.procBeqClist of 50 random realizations of test-processes under null based on resampling.
  • covariancecovariances for nonparametric terms of model.
  • B.iidResample processes for nonparametric terms of model.
  • gamma.iidResample processes for parametric terms of model.
  • devianceTwo components : first component "likelihood" equivalent to partial likelihood for Cox's model, second component sum of least squares of increments.
  • intZHZcomputes the integral int ZHZ dt.
  • intZHdNcomputes the integral int ZH dN.
  • obs.pscorepseudo score test value.
  • pscore.iidiid decomposition of pseudo-score test.
  • intZHZtcomputes the integral int ZHZ dt over time.
  • pstest.pvalpseudo-score p-value.
  • sup.pscoresimulated supremum values for pseudo-score test.

Details

The data for a subject is presented as multiple rows or 'observations', each of which applies to an interval of observation (start, stop]. For counting process data with the )start,stop] notation is used the 'id' variable is needed to identify the records for each subject. The program assumes that there are no ties, and if such are present random noise is added to break the ties.

References

Martinussen and Scheike, Dynamic Regression Models for Survival Data, Springer (2006).

Martinussen and Scheike (200.), Tests for time-varying effects within Aalen's additive hazards model,

Examples

Run this code
library(survival)
data(mela.pop)
# Fits Aalen model  with offsets 
dummy<-rnorm(nrow(mela.pop)); 

out<-aalen.test(Surv(start,stop,status==1)~age+sex+const(dummy),
mela.pop,max.time=7,n.sim=100,offsets=mela.pop$rate,id=mela.pop$id,
fix.gam=1)

summary(out)
par(mfrow=c(2,3))
plot(out)

# Fits semi-parametric additive hazards model  with offsets 
out<-aalen.test(Surv(start,stop,status==1)~age+const(sex),
mela.pop,max.time=7,n.sim=100,offsets=mela.pop$rate,id=mela.pop$id)

summary(out)
plot(out)

################################################################
# Computes pseudo.score tests for fixed effects 
data(sTRACE)
out<-aalen.test(Surv(time,status==9)~const(age)+const(sex)+const(diabetes)+
chf+vf,sTRACE,max.time=7,n.sim=100,pseudo.score=100)

summary(out)

Run the code above in your browser using DataLab