Running ‘testthat.R’ [42s/68s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(casebase)
  See example usage at http://sahirbhatnagar.com/casebase/
  > library(data.table)
  > library(survival)
  > 
  > test_check("casebase")
  Fitting smooth hazards with case-base sampling
  
  Sample size: 200 
  Number of events: 85 
  Number of base moments: 8500 
  ----
  
  Call:
  fitSmoothHazard(formula = event ~ Z, data = DF, time = "ftime")
  
  Deviance Residuals: 
      Min       1Q   Median       3Q      Max  
  -0.1818  -0.1818  -0.1073  -0.1073   3.2127  
  
  Coefficients:
              Estimate Std. Error z value Pr(>|z|)    
  (Intercept)   0.1087     0.1831   0.593    0.553    
  Z             1.0599     0.2281   4.647 3.36e-06 ***
  ---
  Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
  
  (Dispersion parameter for binomial family taken to be 1)
  
      Null deviance: 953.73  on 8584  degrees of freedom
  Residual deviance: 930.82  on 8583  degrees of freedom
  AIC: 934.82
  
  Number of Fisher Scoring iterations: 8
  
  Fitting smooth hazards with case-base sampling
  
  Sample size: 200 
  Number of events: 85 
  Number of base moments: 8500 
  ----
  
  Call:
  fitSmoothHazard(formula = event ~ Z, data = DT, time = "ftime")
  
  Deviance Residuals: 
      Min       1Q   Median       3Q      Max  
  -0.1811  -0.1811  -0.1075  -0.1075   3.2113  
  
  Coefficients:
              Estimate Std. Error z value Pr(>|z|)    
  (Intercept)   0.1131     0.1831   0.618    0.537    
  Z             1.0485     0.2281   4.598 4.27e-06 ***
  ---
  Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
  
  (Dispersion parameter for binomial family taken to be 1)
  
      Null deviance: 953.73  on 8584  degrees of freedom
  Residual deviance: 931.31  on 8583  degrees of freedom
  AIC: 935.31
  
  Number of Fisher Scoring iterations: 8
  
  Fitting smooth hazards with case-base sampling
  
  Sample size: 200 
  Number of events: 77 
  Number of base moments: 770 
  ----
  
  Family: binomial 
  Link function: logit 
  
  Formula:
  event ~ s(ftime) + Z + offset(offset)
  
  Parametric coefficients:
              Estimate Std. Error z value Pr(>|z|)    
  (Intercept)  -0.2348     0.2135  -1.099    0.272    
  Z             1.3336     0.2686   4.964 6.89e-07 ***
  ---
  Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
  
  Approximate significance of smooth terms:
             edf Ref.df Chi.sq p-value
  s(ftime) 1.001  1.001  1.025   0.312
  
  R-sq.(adj) =  0.0388   Deviance explained = 6.56%
  UBRE = -0.42362  Scale est. = 1         n = 847
  Fitting smooth hazards with case-base sampling
  
  Sample size: 200 
  Number of events: 77 
  Number of base moments: 770 
  ----
  
  Family: binomial 
  Link function: logit 
  
  Formula:
  event ~ s(ftime) + Z + offset(offset)
  
  Parametric coefficients:
              Estimate Std. Error z value Pr(>|z|)    
  (Intercept)  -0.2830     0.2133  -1.326    0.185    
  Z             1.4570     0.2677   5.442 5.27e-08 ***
  ---
  Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
  
  Approximate significance of smooth terms:
             edf Ref.df Chi.sq p-value
  s(ftime) 1.003  1.006  1.184   0.279
  
  R-sq.(adj) =  0.0474   Deviance explained = 7.78%
  UBRE = -0.43102  Scale est. = 1         n = 847
  [ FAIL 1 | WARN 3 | SKIP 3 | PASS 235 ]
  
  ══ Skipped tests ═══════════════════════════════════════════════════════════════
  • gbm cannot be loaded (2)
  • gbm not implemented (1)
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Failure ('test-absRiskComp.R:173'): should output probabilities with data tables - two covariate profile ──
  all(absRiskMC <= 1 + eps) is not TRUE
  
  `actual`:   FALSE
  `expected`: TRUE 
  
  [ FAIL 1 | WARN 3 | SKIP 3 | PASS 235 ]
  Error: Test failures
  Execution halted