Running ‘testthat.R’ [41s/64s]
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: 78 
  Number of base moments: 7800 
  ----
  
  Call:
  fitSmoothHazard(formula = event ~ Z, data = DF, time = "ftime")
  
  Coefficients:
              Estimate Std. Error z value Pr(>|z|)    
  (Intercept)  0.00907    0.21878   0.041    0.967    
  Z            1.09450    0.25627   4.271 1.95e-05 ***
  ---
  Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
  
  (Dispersion parameter for binomial family taken to be 1)
  
      Null deviance: 875.18  on 7877  degrees of freedom
  Residual deviance: 854.49  on 7876  degrees of freedom
  AIC: 858.49
  
  Number of Fisher Scoring iterations: 8
  
  Fitting smooth hazards with case-base sampling
  
  Sample size: 200 
  Number of events: 78 
  Number of base moments: 7800 
  ----
  
  Call:
  fitSmoothHazard(formula = event ~ Z, data = DT, time = "ftime")
  
  Coefficients:
              Estimate Std. Error z value Pr(>|z|)    
  (Intercept)   0.0246     0.2188   0.112     0.91    
  Z             1.0621     0.2563   4.145  3.4e-05 ***
  ---
  Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
  
  (Dispersion parameter for binomial family taken to be 1)
  
      Null deviance: 875.18  on 7877  degrees of freedom
  Residual deviance: 855.74  on 7876  degrees of freedom
  AIC: 859.74
  
  Number of Fisher Scoring iterations: 8
  
  Fitting smooth hazards with case-base sampling
  
  Sample size: 200 
  Number of events: 83 
  Number of base moments: 830 
  ----
  
  Family: binomial 
  Link function: logit 
  
  Formula:
  event ~ s(ftime) + Z + offset(offset)
  
  Parametric coefficients:
              Estimate Std. Error z value Pr(>|z|)    
  (Intercept)   0.1258     0.1956   0.643     0.52    
  Z             1.1314     0.2484   4.555 5.24e-06 ***
  ---
  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.474  1.808  0.727   0.692
  
  R-sq.(adj) =  0.0242   Deviance explained =  4.4%
  UBRE = -0.40994  Scale est. = 1         n = 913
  Fitting smooth hazards with case-base sampling
  
  Sample size: 200 
  Number of events: 83 
  Number of base moments: 830 
  ----
  
  Family: binomial 
  Link function: logit 
  
  Formula:
  event ~ s(ftime) + Z + offset(offset)
  
  Parametric coefficients:
              Estimate Std. Error z value Pr(>|z|)    
  (Intercept)   0.1096     0.1953   0.561    0.575    
  Z             1.1601     0.2456   4.724 2.31e-06 ***
  ---
  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.859  2.331  1.798   0.438
  
  R-sq.(adj) =  0.0274   Deviance explained = 4.86%
  UBRE = -0.41187  Scale est. = 1         n = 913
  [ 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