Running ‘testthat.R’ [53s/63s]
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: 74 
  Number of base moments: 7400 
  ----
  
  Call:
  fitSmoothHazard(formula = event ~ Z, data = DF, time = "ftime")
  
  Coefficients:
              Estimate Std. Error z value Pr(>|z|)    
  (Intercept) -0.03705    0.20470  -0.181    0.856    
  Z            1.04732    0.24944   4.199 2.68e-05 ***
  ---
  Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
  
  (Dispersion parameter for binomial family taken to be 1)
  
      Null deviance: 830.30  on 7473  degrees of freedom
  Residual deviance: 811.21  on 7472  degrees of freedom
  AIC: 815.21
  
  Number of Fisher Scoring iterations: 8
  
  Fitting smooth hazards with case-base sampling
  
  Sample size: 200 
  Number of events: 74 
  Number of base moments: 7400 
  ----
  
  Call:
  fitSmoothHazard(formula = event ~ Z, data = DT, time = "ftime")
  
  Coefficients:
              Estimate Std. Error z value Pr(>|z|)    
  (Intercept) -0.04614    0.20469  -0.225    0.822    
  Z            1.06896    0.24944   4.285 1.82e-05 ***
  ---
  Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
  
  (Dispersion parameter for binomial family taken to be 1)
  
      Null deviance: 830.3  on 7473  degrees of freedom
  Residual deviance: 810.4  on 7472  degrees of freedom
  AIC: 814.4
  
  Number of Fisher Scoring iterations: 8
  
  Fitting smooth hazards with case-base sampling
  
  Sample size: 200 
  Number of events: 58 
  Number of base moments: 580 
  ----
  
  Family: binomial 
  Link function: logit 
  
  Formula:
  event ~ s(ftime) + Z + offset(offset)
  
  Parametric coefficients:
              Estimate Std. Error z value Pr(>|z|)  
  (Intercept) -0.02212    0.23058  -0.096   0.9236  
  Z            0.70506    0.28942   2.436   0.0148 *
  ---
  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) 2.68  3.347   7.31  0.0822 .
  ---
  Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
  
  R-sq.(adj) =  0.0235   Deviance explained = 3.37%
  UBRE = -0.39662  Scale est. = 1         n = 638
  Fitting smooth hazards with case-base sampling
  
  Sample size: 200 
  Number of events: 58 
  Number of base moments: 580 
  ----
  
  Family: binomial 
  Link function: logit 
  
  Formula:
  event ~ s(ftime) + Z + offset(offset)
  
  Parametric coefficients:
              Estimate Std. Error z value Pr(>|z|)
  (Intercept)   0.1580     0.2277   0.694    0.488
  Z             0.3875     0.2860   1.355    0.175
  
  Approximate significance of smooth terms:
           edf Ref.df Chi.sq p-value
  s(ftime)   1  1.001  0.966   0.326
  
  R-sq.(adj) =  0.00146   Deviance explained = 0.703%
  UBRE = -0.38561  Scale est. = 1         n = 638
  [ 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:160:5'): should output probabilities with data frames - 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