Running 'aareg.R' [2s]
  Comparing 'aareg.Rout' to 'aareg.Rout.save' ... OK
  Running 'anova.R' [2s]
  Comparing 'anova.Rout' to 'anova.Rout.save' ... OK
  Running 'bladder.R' [2s]
  Comparing 'bladder.Rout' to 'bladder.Rout.save' ... OK
  Running 'book1.R' [3s]
  Comparing 'book1.Rout' to 'book1.Rout.save' ... OK
  Running 'book2.R' [3s]
  Comparing 'book2.Rout' to 'book2.Rout.save' ... OK
  Running 'book3.R' [2s]
  Comparing 'book3.Rout' to 'book3.Rout.save' ... OK
  Running 'book4.R' [2s]
  Comparing 'book4.Rout' to 'book4.Rout.save' ... OK
  Running 'book5.R' [2s]
  Comparing 'book5.Rout' to 'book5.Rout.save' ... OK
  Running 'book6.R' [2s]
  Comparing 'book6.Rout' to 'book6.Rout.save' ... OK
  Running 'book7.R' [2s]
  Comparing 'book7.Rout' to 'book7.Rout.save' ... OK
  Running 'cancer.R' [3s]
  Comparing 'cancer.Rout' to 'cancer.Rout.save' ... OK
  Running 'clogit.R' [2s]
  Comparing 'clogit.Rout' to 'clogit.Rout.save' ... OK
  Running 'concordance.R' [3s]
  Comparing 'concordance.Rout' to 'concordance.Rout.save' ... OK
  Running 'concordance2.R' [12s]
  Comparing 'concordance2.Rout' to 'concordance2.Rout.save' ... OK
  Running 'concordance3.R' [2s]
  Comparing 'concordance3.Rout' to 'concordance3.Rout.save' ... OK
  Running 'counting.R' [2s]
  Comparing 'counting.Rout' to 'counting.Rout.save' ... OK
  Running 'coxsurv.R' [2s]
  Comparing 'coxsurv.Rout' to 'coxsurv.Rout.save' ... OK
  Running 'coxsurv2.R' [2s]
  Comparing 'coxsurv2.Rout' to 'coxsurv2.Rout.save' ... OK
  Running 'coxsurv3.R' [2s]
  Comparing 'coxsurv3.Rout' to 'coxsurv3.Rout.save' ... OK
  Running 'coxsurv4.R' [2s]
  Comparing 'coxsurv4.Rout' to 'coxsurv4.Rout.save' ... OK
  Running 'coxsurv5.R' [3s]
  Comparing 'coxsurv5.Rout' to 'coxsurv5.Rout.save' ... OK
  Running 'detail.R' [2s]
  Comparing 'detail.Rout' to 'detail.Rout.save' ... OK
  Running 'difftest.R' [2s]
  Comparing 'difftest.Rout' to 'difftest.Rout.save' ... OK
  Running 'doaml.R' [2s]
  Comparing 'doaml.Rout' to 'doaml.Rout.save' ... OK
  Running 'doweight.R' [2s]
  Comparing 'doweight.Rout' to 'doweight.Rout.save' ... OK
  Running 'expected.R' [2s]
  Comparing 'expected.Rout' to 'expected.Rout.save' ... OK
  Running 'expected2.R' [2s]
  Comparing 'expected2.Rout' to 'expected2.Rout.save' ... OK
  Running 'factor.R' [2s]
  Comparing 'factor.Rout' to 'factor.Rout.save' ... OK
  Running 'factor2.R' [2s]
  Comparing 'factor2.Rout' to 'factor2.Rout.save' ... OK
  Running 'finegray.R' [2s]
  Comparing 'finegray.Rout' to 'finegray.Rout.save' ... OK
  Running 'fr_cancer.R' [2s]
  Comparing 'fr_cancer.Rout' to 'fr_cancer.Rout.save' ... OK
  Running 'fr_kidney.R' [2s]
  Comparing 'fr_kidney.Rout' to 'fr_kidney.Rout.save' ... OK
  Running 'fr_lung.R' [2s]
  Comparing 'fr_lung.Rout' to 'fr_lung.Rout.save' ... OK
  Running 'fr_ovarian.R' [2s]
  Comparing 'fr_ovarian.Rout' to 'fr_ovarian.Rout.save' ... OK
  Running 'fr_rat1.R' [2s]
  Comparing 'fr_rat1.Rout' to 'fr_rat1.Rout.save' ... OK
  Running 'fr_resid.R' [2s]
  Comparing 'fr_resid.Rout' to 'fr_resid.Rout.save' ... OK
  Running 'fr_simple.R' [2s]
  Comparing 'fr_simple.Rout' to 'fr_simple.Rout.save' ... OK
  Running 'frailty.R' [2s]
  Comparing 'frailty.Rout' to 'frailty.Rout.save' ... OK
  Running 'frank.R' [2s]
  Comparing 'frank.Rout' to 'frank.Rout.save' ... OK
  Running 'infcox.R' [2s]
  Comparing 'infcox.Rout' to 'infcox.Rout.save' ... OK
  Running 'jasa.R' [2s]
  Comparing 'jasa.Rout' to 'jasa.Rout.save' ... OK
  Running 'model.matrix.R' [2s]
  Comparing 'model.matrix.Rout' to 'model.matrix.Rout.save' ... OK
  Running 'mstate.R' [2s]
  Comparing 'mstate.Rout' to 'mstate.Rout.save' ... OK
  Running 'multi2.R' [2s]
  Comparing 'multi2.Rout' to 'multi2.Rout.save' ... OK
  Running 'multistate.R' [3s]
  Running 'nested.R' [2s]
  Comparing 'nested.Rout' to 'nested.Rout.save' ... OK
  Running 'ovarian.R' [2s]
  Comparing 'ovarian.Rout' to 'ovarian.Rout.save' ... OK
  Running 'overlap.R' [2s]
  Comparing 'overlap.Rout' to 'overlap.Rout.save' ... OK
  Running 'prednew.R' [2s]
  Comparing 'prednew.Rout' to 'prednew.Rout.save' ... OK
  Running 'pspline.R' [3s]
  Comparing 'pspline.Rout' to 'pspline.Rout.save' ... OK
  Running 'pyear.R' [2s]
  Comparing 'pyear.Rout' to 'pyear.Rout.save' ... OK
  Running 'quantile.R' [3s]
  Comparing 'quantile.Rout' to 'quantile.Rout.save' ... OK
  Running 'r_donnell.R' [3s]
  Comparing 'r_donnell.Rout' to 'r_donnell.Rout.save' ... OK
  Running 'r_lung.R' [2s]
  Comparing 'r_lung.Rout' to 'r_lung.Rout.save' ... OK
  Running 'r_peterson.R' [2s]
  Comparing 'r_peterson.Rout' to 'r_peterson.Rout.save' ... OK
  Running 'r_resid.R' [2s]
  Comparing 'r_resid.Rout' to 'r_resid.Rout.save' ... OK
  Running 'r_sas.R' [8s]
  Comparing 'r_sas.Rout' to 'r_sas.Rout.save' ...412,413c412,413
< null device 
<           1 
---
> pdf 
>   2 
  Running 'r_scale.R' [2s]
  Comparing 'r_scale.Rout' to 'r_scale.Rout.save' ... OK
  Running 'r_stanford.R' [2s]
  Comparing 'r_stanford.Rout' to 'r_stanford.Rout.save' ... OK
  Running 'r_strata.R' [2s]
  Comparing 'r_strata.Rout' to 'r_strata.Rout.save' ... OK
  Running 'r_tdist.R' [2s]
  Comparing 'r_tdist.Rout' to 'r_tdist.Rout.save' ... OK
  Running 'r_user.R' [2s]
  Comparing 'r_user.Rout' to 'r_user.Rout.save' ... OK
  Running 'ratetable.R' [1s]
  Comparing 'ratetable.Rout' to 'ratetable.Rout.save' ... OK
  Running 'singtest.R' [2s]
  Comparing 'singtest.Rout' to 'singtest.Rout.save' ... OK
  Running 'strata2.R' [2s]
  Comparing 'strata2.Rout' to 'strata2.Rout.save' ... OK
  Running 'stratatest.R' [1s]
  Comparing 'stratatest.Rout' to 'stratatest.Rout.save' ... OK
  Running 'summary_survfit.R' [3s]
  Comparing 'summary_survfit.Rout' to 'summary_survfit.Rout.save' ... OK
  Running 'surv.R' [2s]
  Comparing 'surv.Rout' to 'surv.Rout.save' ... OK
  Running 'survSplit.R' [2s]
  Comparing 'survSplit.Rout' to 'survSplit.Rout.save' ... OK
  Running 'survcheck.R' [2s]
  Comparing 'survcheck.Rout' to 'survcheck.Rout.save' ... OK
  Running 'survfit1.R' [2s]
  Comparing 'survfit1.Rout' to 'survfit1.Rout.save' ... OK
  Running 'survfit2.R' [1s]
  Comparing 'survfit2.Rout' to 'survfit2.Rout.save' ... OK
  Running 'survreg1.R' [2s]
  Comparing 'survreg1.Rout' to 'survreg1.Rout.save' ... OK
  Running 'survreg2.R' [2s]
  Comparing 'survreg2.Rout' to 'survreg2.Rout.save' ... OK
  Running 'survtest.R' [2s]
  Comparing 'survtest.Rout' to 'survtest.Rout.save' ... OK
  Running 'testci.R' [2s]
  Comparing 'testci.Rout' to 'testci.Rout.save' ... OK
  Running 'testci2.R' [2s]
  Comparing 'testci2.Rout' to 'testci2.Rout.save' ... OK
  Running 'testnull.R' [2s]
  Comparing 'testnull.Rout' to 'testnull.Rout.save' ... OK
  Running 'testreg.R' [2s]
  Comparing 'testreg.Rout' to 'testreg.Rout.save' ... OK
  Running 'tiedtime.R' [2s]
  Comparing 'tiedtime.Rout' to 'tiedtime.Rout.save' ... OK
  Running 'tmerge.R' [2s]
  Comparing 'tmerge.Rout' to 'tmerge.Rout.save' ... OK
  Running 'tmerge2.R' [1s]
  Comparing 'tmerge2.Rout' to 'tmerge2.Rout.save' ... OK
  Running 'tmerge3.R' [2s]
  Comparing 'tmerge3.Rout' to 'tmerge3.Rout.save' ... OK
  Running 'tt.R' [2s]
  Comparing 'tt.Rout' to 'tt.Rout.save' ... OK
  Running 'turnbull.R' [2s]
  Comparing 'turnbull.Rout' to 'turnbull.Rout.save' ... OK
  Running 'update.R' [2s]
  Comparing 'update.Rout' to 'update.Rout.save' ... OK
  Running 'yates0.R' [0s]
  Comparing 'yates0.Rout' to 'yates0.Rout.save' ... OK
  Running 'yates1.R' [2s]
  Comparing 'yates1.Rout' to 'yates1.Rout.save' ... OK
  Running 'yates2.R' [2s]
  Running 'zph.R' [3s]
  Comparing 'zph.Rout' to 'zph.Rout.save' ... OK
Running the tests in 'tests/multistate.R' failed.
Complete output:
  > #
  > # Tests for multi-state Cox models
  > #
  > library(survival)
  > 
  > aeq <- function(x,y, ...) all.equal(as.vector(x), as.vector(y), ...)
  > 
  > #  There are a few subjects with progression and death on the same day. In the
  > # usual multi-state data set only one will count. 
  > data1 <- mgus2
  > data1$etime <- with(data1, ifelse(pstat==1, ptime, futime))
  > data1$event <- factor(ifelse(data1$pstat==1, 1, 2L*data1$death),
  +                       0:2, c("censor", "PCM", "death"))
  > 
  > data2 <- mgus2[rep(1:nrow(mgus2) ,2), c("id", "age", "sex", "mspike")]
  > data2$time <- rep(data1$etime, 2)
  > data2$status <- 1* c(data1$event=="PCM", data1$event=="death")
  > data2$type   <- rep(c(2:3), each=nrow(mgus2))
  > 
  > fit1 <- coxph(Surv(etime, event) ~ age + sex + mspike, data1, id=id, x=TRUE,
  +               robust=FALSE)
  > fit1a <- coxph(Surv(etime, event=="PCM") ~ age + sex + mspike, data1)
  > fit1b <- coxph(Surv(etime, event=='death') ~ age + sex + mspike, data1)
  > fit1c <- coxph(Surv(time, status) ~ strata(type)/(age + sex+ mspike), 
  +                data2, x=TRUE)
  > 
  > aeq(fit1$loglik, fit1a$loglik + fit1b$loglik)
  [1] TRUE
  > aeq(fit1$coef, c(fit1a$coef, fit1b$coef))
  [1] TRUE
  > aeq(fit1$var[1:3, 1:3], fit1a$var)
  [1] TRUE
  > aeq(fit1$var[4:6, 4:6], fit1b$var)
  [1] TRUE
  > aeq(fit1$x[,c(1,4,2,5,3,6)], fit1c$x)
  [1] TRUE
  > aeq(fit1$coef[c(1,4,2,5,3,6)], fit1c$coef)
  [1] TRUE
  > 
  > # force a common age effect across all states
  > fit2 <- coxph(list(Surv(etime, event) ~ sex,
  +                                   1:0 ~ age / common), 
  +               data1, id=id)
  > 
  > data2 <- rbind(cbind(data1, status= (data1$event=="PCM"), etype=1),
  +                cbind(data1, status= (data1$event=='death'), etype=2))
  > fit2a <- coxph(Surv(etime, status) ~ age + strata(etype)/sex, data2)
  > 
  > aeq(coef(fit2), coef(fit2a)[c(2,1,3)])  # not in the same order
  [1] TRUE
  > aeq(fit2$loglik, fit2a$loglik)
  [1] TRUE
  > 
  > #same fit in more complex ways
  > data1$entry <- "Entry"
  > fit2b <-  coxph(list(Surv(etime, event) ~ sex,
  +                      "Entry":"PCM" + "Entry":"death" ~ age / common),
  +                 istate=entry, data1, id=id)
  > fit2c <-  coxph(list(Surv(etime, event) ~ sex,
  +                      "Entry":state(c("PCM", "death")) ~ age / common),
  +                 istate=entry, data1, id=id)
  > 
  > aeq(fit2b$loglik, fit2$loglik)
  [1] TRUE
  > aeq(fit2c$coef, fit2$coef)
  [1] TRUE
  > 
  > # mspike size as a covariate for PCM only
  > # first, 3 different ways to write the same
  > fit3 <- coxph(list(Surv(etime, event) ~ age + sex,
  +                    1:state("PCM") ~ mspike),
  +               data1, id=id)
  > fit3b <- coxph(list(Surv(etime, event) ~ age + sex,
  +                    1:"PCM" ~ mspike),
  +               data1, id=id)
  > fit3c <- coxph(list(Surv(etime, event) ~ age + sex,
  +                    1:c("PCM") ~ mspike),
  +               data1, id=id)
  Error in if (flag["teleport"] > 0) { : 
    missing value where TRUE/FALSE needed
  Calls: coxph -> survcheck2
  Execution halted