CRAN Package Check Results for Package stdReg2

Last updated on 2026-10-24 09:51:04 CEST.

Flavor Version Tinstall Tcheck Ttotal Status Flags
r-devel-linux-x86_64-debian-clang 1.0.7 10.72 119.63 130.35 OK
r-devel-linux-x86_64-debian-gcc 1.0.7 7.43 76.28 83.71 ERROR
r-devel-linux-x86_64-fedora-clang 1.0.7 10.00 105.31 115.31 OK
r-devel-linux-x86_64-fedora-gcc 1.0.7 86.44 OK
r-devel-windows-x86_64 1.0.7 11.00 127.00 138.00 OK
r-patched-linux-x86_64 1.0.7 10.00 108.91 118.91 OK
r-release-linux-x86_64 1.0.7 9.21 108.56 117.77 OK
r-release-macos-arm64 1.0.7 3.00 32.00 35.00 OK
r-release-macos-x86_64 1.0.7 7.00 138.00 145.00 OK
r-release-windows-x86_64 1.0.7 11.00 119.00 130.00 OK
r-oldrel-macos-arm64 1.0.7 2.00 37.00 39.00 OK
r-oldrel-macos-x86_64 1.0.7 7.00 110.00 117.00 OK
r-oldrel-windows-x86_64 1.0.7 16.00 148.00 164.00 OK

Check Details

Version: 1.0.7
Check: examples
Result: ERROR Running examples in ‘stdReg2-Ex.R’ failed The error most likely occurred in: > base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: standardize > ### Title: Get standardized estimates using the g-formula with a custom > ### model > ### Aliases: standardize > > ### ** Examples > > > set.seed(6) > n <- 100 > Z <- rnorm(n) > X <- rnorm(n, mean = Z) > Y <- rbinom(n, 1, prob = (1 + exp(X + Z))^(-1)) > dd <- data.frame(Z, X, Y) > prob_predict.glm <- function(...) predict.glm(..., type = "response") > > x <- standardize( + fitter = "glm", + arguments = list( + formula = Y ~ X * Z, + family = "binomial" + ), + predict_fun = prob_predict.glm, + data = dd, + values = list(X = seq(-1, 1, 0.1)), + B = 100, + reference = 0, + contrasts = "difference" + ) | | | 0% | |= | 1% | |= | 2% | |== | 3% | |== | 4% | |=== | 5% | |=== | 6% | |==== | 7% | |==== | 8% | |===== | 9% | |===== | 10% | |====== | 11% | |====== | 12% | |======= | 13% | |======= | 14% | |======== | 15% | |======== | 16% | |========= | 17% | |========= | 18% | |========== | 19% | |========== | 20% | |=========== | 21% | |=========== | 22% | |============ | 23% | |============ | 24% | |============= | 25% | |============= | 26% | |============== | 27% | |============== | 28% | |=============== | 29% | |=============== | 30% | |================ | 31% | |================ | 32% | |================= | 33% | |================= | 34% | |================== | 35% | |================== | 36% | |=================== | 37% | |=================== | 38% | |==================== | 39% | |==================== | 40% | |===================== | 41% | |===================== | 42% | |====================== | 43% | |====================== | 44% | |======================= | 45% | |======================= | 46% | |======================== | 47% | |======================== | 48% | |========================= | 49% | |========================= | 51% | |========================== | 52% | |========================== | 53% | |=========================== | 54% | |=========================== | 55% | |============================ | 56% | |============================ | 57% | |============================= | 58% | |============================= | 59% | |============================== | 60% | |============================== | 61% | |=============================== | 62% | |=============================== | 63% | |================================ | 64% | |================================ | 65% | |================================= | 66% | |================================= | 67% | |================================== | 68% | |================================== | 69% | |=================================== | 70% | |=================================== | 71% | |==================================== | 72% | |==================================== | 73% | |===================================== | 74% | |===================================== | 75% | |====================================== | 76% | |====================================== | 77% | |======================================= | 78% | |======================================= | 79% | |======================================== | 80% | |======================================== | 81% | |========================================= | 82% | |========================================= | 83% | |========================================== | 84% | |========================================== | 85% | |=========================================== | 86% | |=========================================== | 87% | |============================================ | 88% | |============================================ | 89% | |============================================= | 90% | |============================================= | 91% | |============================================== | 92% | |============================================== | 93% | |=============================================== | 94% | |=============================================== | 95% | |================================================ | 96% | |================================================ | 97% | |================================================= | 98% | |================================================= | 99% | |==================================================| 100%> x Number of bootstraps: 100 Confidence intervals are based on percentile bootstrap confidence intervals Exposure: X Tables: X Estimate lower.0.95 upper.0.95 1 -1.0 0.689 0.537 0.882 2 -0.9 0.671 0.526 0.865 3 -0.8 0.653 0.521 0.845 4 -0.7 0.635 0.515 0.822 5 -0.6 0.617 0.508 0.797 6 -0.5 0.600 0.493 0.770 7 -0.4 0.583 0.476 0.745 8 -0.3 0.566 0.466 0.720 9 -0.2 0.550 0.450 0.699 10 -0.1 0.534 0.429 0.679 11 0.0 0.519 0.409 0.658 12 0.1 0.504 0.389 0.638 13 0.2 0.490 0.369 0.621 14 0.3 0.476 0.348 0.608 15 0.4 0.462 0.322 0.595 16 0.5 0.449 0.298 0.587 17 0.6 0.437 0.275 0.583 18 0.7 0.425 0.254 0.577 19 0.8 0.413 0.235 0.571 20 0.9 0.401 0.222 0.561 21 1.0 0.391 0.207 0.551 Reference level: = 0 Contrast: difference X Estimate lower.0.95 upper.0.95 1 -1.0 0.1697 0.04037 0.30879 2 -0.9 0.1516 0.03562 0.28505 3 -0.8 0.1335 0.03104 0.25348 4 -0.7 0.1156 0.02663 0.22134 5 -0.6 0.0980 0.02238 0.19201 6 -0.5 0.0807 0.01829 0.16211 7 -0.4 0.0637 0.01435 0.13054 8 -0.3 0.0472 0.01056 0.09810 9 -0.2 0.0310 0.00691 0.06525 10 -0.1 0.0153 0.00339 0.03243 11 0.0 0.0000 0.00000 0.00000 12 0.1 -0.0148 -0.03177 -0.00326 13 0.2 -0.0292 -0.06286 -0.00641 14 0.3 -0.0432 -0.09365 -0.00944 15 0.4 -0.0566 -0.12370 -0.01237 16 0.5 -0.0697 -0.15192 -0.01519 17 0.6 -0.0823 -0.17663 -0.01791 18 0.7 -0.0945 -0.19954 -0.02054 19 0.8 -0.1062 -0.22074 -0.02308 20 0.9 -0.1176 -0.24033 -0.02553 21 1.0 -0.1285 -0.25891 -0.02790 > > require(survival) Loading required package: survival > prob_predict.coxph <- function(object, newdata, times) { + fit.detail <- suppressWarnings(basehaz(object)) + cum.haz <- fit.detail$hazard[sapply(times, function(x) max(which(fit.detail$time <= x)))] + predX <- predict(object = object, newdata = newdata, type = "risk") + res <- matrix(NA, ncol = length(times), nrow = length(predX)) + for (ti in seq_len(length(times))) { + res[, ti] <- exp(-predX * cum.haz[ti]) + } + res + } > set.seed(68) > n <- 500 > Z <- rnorm(n) > X <- rnorm(n, mean = Z) > T <- rexp(n, rate = exp(X + Z + X * Z)) # survival time > C <- rexp(n, rate = exp(X + Z + X * Z)) # censoring time > U <- pmin(T, C) # time at risk > D <- as.numeric(T < C) # event indicator > dd <- data.frame(Z, X, U, D) > x <- standardize( + fitter = "coxph", + arguments = list( + formula = Surv(U, D) ~ X + Z + X * Z, + method = "breslow", + x = TRUE, + y = TRUE + ), + predict_fun = prob_predict.coxph, + data = dd, + times = 1:5, + values = list(X = c(-1, 0, 1)), + B = 100, + reference = 0, + contrasts = "difference" + ) Error in a$specials[[i]] : subscript out of bounds Calls: standardize ... predict_fun -> predict -> predict.coxph -> delete.response -> off Execution halted Flavor: r-devel-linux-x86_64-debian-gcc

Version: 1.0.7
Check: tests
Result: ERROR Running ‘testthat.R’ [6s/6s] Running the tests in ‘tests/testthat.R’ failed. Complete output: > # This file is part of the standard setup for testthat. > # It is recommended that you do not modify it. > # > # Where should you do additional test configuration? > # Learn more about the roles of various files in: > # * https://r-pkgs.org/tests.html > # * https://testthat.r-lib.org/reference/test_package.html#special-files > > library(testthat) > library(stdReg2) > > test_check("stdReg2") Loading required package: survival Saving _problems/test-standardize-37.R Saving _problems/test-standardize-86.R Saving _problems/test-standardize_coxph-15.R Saving _problems/test-standardize_coxph-40.R Loading required package: drgee [ FAIL 4 | WARN 0 | SKIP 0 | PASS 19 ] ══ Failed tests ════════════════════════════════════════════════════════════════ ── Error ('test-standardize.R:37:5'): standardize with survival data (no bootstrap) gives the same as standardize_coxph ── <subscriptOutOfBoundsError/error/condition> Error in `a$specials[[i]]`: subscript out of bounds Backtrace: ▆ 1. └─stdReg2::standardize(...) at test-standardize.R:53:3 2. └─stdReg2 (local) estimate_fun(valuesout, times, data, fit_outcome) 3. ├─base::colMeans(...) 4. │ └─base::is.data.frame(x) 5. └─stdReg2 (local) predict_fun(object = fit_outcome, newdata = data_x, times = times) 6. ├─stats::predict(object = object, newdata = newdata, type = "risk") at test-standardize.R:37:5 7. └─survival:::predict.coxph(...) 8. └─stats::delete.response(Terms) 9. └─stats (local) off(a$specials[[i]]) ── Error ('test-standardize.R:86:5'): standardize generates output with survival data (single time point) ── <subscriptOutOfBoundsError/error/condition> Error in `a$specials[[i]]`: subscript out of bounds Backtrace: ▆ 1. └─stdReg2::standardize(...) at test-standardize.R:102:3 2. └─stdReg2 (local) estimate_fun(valuesout, times, data, fit_outcome) 3. ├─base::colMeans(...) 4. │ └─base::is.data.frame(x) 5. └─stdReg2 (local) predict_fun(object = fit_outcome, newdata = data_x, times = times) 6. ├─stats::predict(object = object, newdata = newdata, type = "risk") at test-standardize.R:86:5 7. └─survival:::predict.coxph(...) 8. └─stats::delete.response(Terms) 9. └─stats (local) off(a$specials[[i]]) ── Error ('test-standardize_coxph.R:12:3'): check estimates and standard errors against older package (coxph) ── <subscriptOutOfBoundsError/error/condition> Error in `a$specials[[i]]`: subscript out of bounds Backtrace: ▆ 1. └─stdReg2::standardize_coxph(...) at test-standardize_coxph.R:12:3 2. └─stdReg2::sandwich(...) 3. ├─stats::predict(object = fit, type = "risk") 4. └─survival:::predict.coxph(object = fit, type = "risk") 5. └─stats::delete.response(Terms) 6. └─stats (local) off(a$specials[[i]]) ── Error ('test-standardize_coxph.R:39:3'): standard error for coxph with factors bug is fixed ── <subscriptOutOfBoundsError/error/condition> Error in `a$specials[[i]]`: subscript out of bounds Backtrace: ▆ 1. ├─generics::tidy(...) at test-standardize_coxph.R:39:3 2. └─stdReg2::standardize_coxph(...) 3. └─stdReg2::sandwich(...) 4. ├─stats::predict(object = fit, type = "risk") 5. └─survival:::predict.coxph(object = fit, type = "risk") 6. └─stats::delete.response(Terms) 7. └─stats (local) off(a$specials[[i]]) [ FAIL 4 | WARN 0 | SKIP 0 | PASS 19 ] Error: ! Test failures. Execution halted Flavor: r-devel-linux-x86_64-debian-gcc