Running ‘testthat.R’ [52s/60s]
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.1058     0.2136  -0.495     0.62    
  Z             1.5707     0.2503   6.275 3.49e-10 ***
  ---
  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: 874.17  on 8280  degrees of freedom
  AIC: 878.17
  
  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.1011     0.2136  -0.473    0.636    
  Z             1.5576     0.2503   6.223 4.88e-10 ***
  ---
  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: 874.95  on 8280  degrees of freedom
  AIC: 878.95
  
  Number of Fisher Scoring iterations: 8
  
  Fitting smooth hazards with case-base sampling
  
  Sample size: 200 
  Number of events: 73 
  Number of base moments: 730 
  ----
  
  Family: binomial 
  Link function: logit 
  
  Formula:
  event ~ s(ftime) + Z + offset(offset)
  
  Parametric coefficients:
              Estimate Std. Error z value Pr(>|z|)    
  (Intercept)   0.1289     0.1975   0.653 0.513959    
  Z             0.9850     0.2591   3.802 0.000144 ***
  ---
  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.004  1.007  0.438   0.509
  
  R-sq.(adj) =  0.0157   Deviance explained = 3.08%
  UBRE = -0.40199  Scale est. = 1         n = 803
  Fitting smooth hazards with case-base sampling
  
  Sample size: 200 
  Number of events: 73 
  Number of base moments: 730 
  ----
  
  Family: binomial 
  Link function: logit 
  
  Formula:
  event ~ s(ftime) + Z + offset(offset)
  
  Parametric coefficients:
              Estimate Std. Error z value Pr(>|z|)    
  (Intercept)   0.1582     0.1987   0.796  0.42604    
  Z             0.8948     0.2586   3.460  0.00054 ***
  ---
  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.508  1.864  1.153   0.442
  
  R-sq.(adj) =  0.0122   Deviance explained = 2.76%
  UBRE = -0.39882  Scale est. = 1         n = 803
  [ 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: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