R Under development (unstable) (2024-11-28 r87392 ucrt) -- "Unsuffered Consequences" Copyright (C) 2024 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > ## -- Test utils & settings > source("test_util.R") > .run_test <- identical(Sys.getenv("NOT_CRAN"), "true") > oldopt <- options(digits = 4) > set.seed(100) > > library("tramME") Loading required package: tram Loading required package: mlt Loading required package: basefun Loading required package: variables Loading required package: mvtnorm > library("tram") > library("survival") > > m1 <- SurvregME(Surv(time, status) ~ rx, data = rats, dist = "exponential") > m2 <- survreg(Surv(time, status) ~ rx, data = rats, dist = "exponential") > chkeq(logLik(m1), logLik(m2), check.attributes = FALSE) > chkeq(coef(m1, as.survreg = TRUE), coef(m2), tol = 1e-6) > > m1 <- SurvregME(Surv(time, status) ~ rx, data = rats, dist = "lognormal", + fixed = c("rx" = -0.4)) > m2 <- Survreg(Surv(time, status) ~ rx, data = rats, dist = "lognormal", + fixed = c("rx" = -0.4)) > stopifnot(m1$opt$convergence == 0, m2$convergence == 0) > chkeq(logLik(m1), logLik(m2), check.attributes = FALSE) > chkeq(coef(m1, with_baseline = TRUE), coef(m2, with_baseline = TRUE), tol = 1e-4) > > summarize_tests() ========================== Number of failed tests: 0 ========================== > > options(oldopt) > > proc.time() user system elapsed 1.09 0.31 1.39