* using log directory ‘/data/gannet/ripley/R/packages/tests-Suggests/hrIPW.Rcheck’ * using R Under development (unstable) (2022-05-18 r82372) * using platform: x86_64-pc-linux-gnu (64-bit) * using session charset: UTF-8 * using option ‘--no-stop-on-test-error’ * checking for file ‘hrIPW/DESCRIPTION’ ... OK * this is package ‘hrIPW’ version ‘0.1.3’ * package encoding: UTF-8 * checking package namespace information ... OK * checking package dependencies ... NOTE Package suggested but not available for checking: ‘RISCA’ * checking if this is a source package ... OK * checking if there is a namespace ... OK * checking for executable files ... OK * checking for hidden files and directories ... OK * checking for portable file names ... OK * checking for sufficient/correct file permissions ... OK * checking whether package ‘hrIPW’ can be installed ... [11s/12s] OK * checking package directory ... OK * checking DESCRIPTION meta-information ... OK * checking top-level files ... OK * checking for left-over files ... OK * checking index information ... OK * checking package subdirectories ... OK * checking R files for non-ASCII characters ... OK * checking R files for syntax errors ... OK * checking whether the package can be loaded ... OK * checking whether the package can be loaded with stated dependencies ... OK * checking whether the package can be unloaded cleanly ... OK * checking whether the namespace can be loaded with stated dependencies ... OK * checking whether the namespace can be unloaded cleanly ... OK * checking loading without being on the library search path ... OK * checking use of S3 registration ... OK * checking dependencies in R code ... OK * checking S3 generic/method consistency ... OK * checking replacement functions ... OK * checking foreign function calls ... OK * checking R code for possible problems ... [14s/15s] OK * checking Rd files ... OK * checking Rd metadata ... OK * checking Rd line widths ... OK * checking Rd cross-references ... OK * checking for missing documentation entries ... OK * checking for code/documentation mismatches ... OK * checking Rd \usage sections ... OK * checking Rd contents ... OK * checking for unstated dependencies in examples ... OK * checking contents of ‘data’ directory ... OK * checking data for non-ASCII characters ... OK * checking LazyData ... OK * checking data for ASCII and uncompressed saves ... OK * checking examples ... [16s/16s] ERROR Running examples in ‘hrIPW-Ex.R’ failed The error most likely occurred in: > ### Name: hrIPW > ### Title: Hazard ratio estimation using Cox model weighted by the > ### propensity score > ### Aliases: hrIPW > > ### ** Examples > > ## Using a simulated cohort > data(hrData, package = "hrIPW") > hrIPW(hrData, time = "time", status = "status", exposure = "Trt", + variables = paste("X", 1:9, sep = ""), wtype = "ATE-stab") $coefficient [1] -0.01717167 $std [1] 0.03282054 $ciinf [1] -0.08149875 $cisup [1] 0.04715541 $p.value [1] 0.6008359 > > # Standard error could be compared with the (robust) Lin's standard error > # which does not take into account the propensity score estimation step: > modT <- glm(Trt ~ X1 + X2 + X3 + X4 + X5 + X6 + X7 + X8 + X9, data = hrData, family = "binomial") > probT <- predict(modT, type = "response") > hrData$w <- 1/ifelse(hrData$Trt == 1, probT, 1 - probT) > library(survival) > coxph(Surv(time, status) ~ Trt + cluster(id), data = hrData, method = "breslow", weights = w) Call: coxph(formula = Surv(time, status) ~ Trt, data = hrData, weights = w, method = "breslow", cluster = id) coef exp(coef) se(coef) robust se z p Trt -0.01743 0.98272 0.01415 0.03543 -0.492 0.623 Likelihood ratio test=1.52 on 1 df, p=0.2182 n= 10000, number of events= 10000 > > # or with the bootstrap-based standard-error (see Austin 2016): > ## Not run: > ##D f.boot <- function(data, i, wtype) { > ##D df <- data[i, ] > ##D modT <- glm(Trt ~ X1 + X2 + X3 + X4 + X5 + X6 + X7 + X8 + X9, data = df, family = "binomial") > ##D probT <- predict(modT, type = "response") > ##D df$w <- 1/ifelse(df$Trt == 1, probT, 1 - probT) > ##D > ##D return(coxph(Surv(time, status) ~ Trt, data = df, weights = w)$coef) > ##D } > ##D > ##D library(boot); set.seed(1234) > ##D rcoefs <- boot(data = hrData, statistic = f.boot, R = 500)$t > ##D sd(rcoefs) > ## End(Not run) > > ## Using the DIVAT data base (package IPWsurvival, to be installed) > data(dataDIVAT2, package = "RISCA") Error in find.package(package, lib.loc, verbose = verbose) : there is no package called ‘RISCA’ Calls: data -> find.package Execution halted * checking PDF version of manual ... OK * checking for non-standard things in the check directory ... OK * checking for detritus in the temp directory ... OK * DONE Status: 1 ERROR, 1 NOTE See ‘/data/gannet/ripley/R/packages/tests-Suggests/hrIPW.Rcheck/00check.log’ for details. Command exited with non-zero status 1 Time 1:48.96, 96.31 + 9.78