Running ‘testthat.R’ [41s/65s]
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: 82 
  Number of base moments: 8200 
  ----
  
  Call:
  fitSmoothHazard(formula = event ~ Z, data = DF, time = "ftime")
  
  Coefficients:
              Estimate Std. Error z value Pr(>|z|)    
  (Intercept) -0.06312    0.20902  -0.302    0.763    
  Z            1.27634    0.24684   5.171 2.33e-07 ***
  ---
  Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
  
  (Dispersion parameter for binomial family taken to be 1)
  
      Null deviance: 920.07  on 8281  degrees of freedom
  Residual deviance: 889.70  on 8280  degrees of freedom
  AIC: 893.7
  
  Number of Fisher Scoring iterations: 8
  
  Fitting smooth hazards with case-base sampling
  
  Sample size: 200 
  Number of events: 82 
  Number of base moments: 8200 
  ----
  
  Call:
  fitSmoothHazard(formula = event ~ Z, data = DT, time = "ftime")
  
  Coefficients:
              Estimate Std. Error z value Pr(>|z|)    
  (Intercept)  -0.1023     0.2090  -0.490    0.624    
  Z             1.3730     0.2469   5.562 2.67e-08 ***
  ---
  Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
  
  (Dispersion parameter for binomial family taken to be 1)
  
      Null deviance: 920.07  on 8281  degrees of freedom
  Residual deviance: 884.78  on 8280  degrees of freedom
  AIC: 888.78
  
  Number of Fisher Scoring iterations: 8
  
  Fitting smooth hazards with case-base sampling
  
  Sample size: 200 
  Number of events: 79 
  Number of base moments: 790 
  ----
  
  Family: binomial 
  Link function: logit 
  
  Formula:
  event ~ s(ftime) + Z + offset(offset)
  
  Parametric coefficients:
              Estimate Std. Error z value Pr(>|z|)  
  (Intercept)   0.2926     0.1809   1.618   0.1056  
  Z             0.4888     0.2440   2.003   0.0451 *
  ---
  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.301   1.54  0.831   0.422
  
  R-sq.(adj) =  0.00492   Deviance explained = 1.34%
  UBRE = -0.39127  Scale est. = 1         n = 869
  Fitting smooth hazards with case-base sampling
  
  Sample size: 200 
  Number of events: 79 
  Number of base moments: 790 
  ----
  
  Family: binomial 
  Link function: logit 
  
  Formula:
  event ~ s(ftime) + Z + offset(offset)
  
  Parametric coefficients:
              Estimate Std. Error z value Pr(>|z|)  
  (Intercept)   0.2260     0.1810   1.249   0.2117  
  Z             0.6238     0.2456   2.540   0.0111 *
  ---
  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.742   2.17  2.946   0.249
  
  R-sq.(adj) =  0.00981   Deviance explained = 2.32%
  UBRE = -0.39625  Scale est. = 1         n = 869
  [ FAIL 1 | WARN 3 | SKIP 3 | PASS 235 ]
  
  ══ Skipped tests (3) ═══════════════════════════════════════════════════════════
  • gbm cannot be loaded (2): 'test-plotHazard.R:3:1',
    'test-plotSingleEventCB.R:3:1'
  • gbm not implemented (1): 'test-gbm.R:2:1'
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Failure ('test-absRiskComp.R:173:5'): 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