Running ‘testthat.R’ [41s/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")
  
  Deviance Residuals: 
      Min       1Q   Median       3Q      Max  
  -0.1696  -0.1696  -0.1160  -0.1160   3.1637  
  
  Coefficients:
              Estimate Std. Error z value Pr(>|z|)   
  (Intercept)   0.1293     0.1863   0.694  0.48781   
  Z             0.7632     0.2393   3.190  0.00142 **
  ---
  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: 819.81  on 7472  degrees of freedom
  AIC: 823.81
  
  Number of Fisher Scoring iterations: 7
  
  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")
  
  Deviance Residuals: 
      Min       1Q   Median       3Q      Max  
  -0.1715  -0.1715  -0.1151  -0.1151   3.1687  
  
  Coefficients:
              Estimate Std. Error z value Pr(>|z|)    
  (Intercept)   0.1131     0.1863   0.607   0.5438    
  Z             0.8022     0.2393   3.353   0.0008 ***
  ---
  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: 818.71  on 7472  degrees of freedom
  AIC: 822.71
  
  Number of Fisher Scoring iterations: 7
  
  Fitting smooth hazards with case-base sampling
  
  Sample size: 200 
  Number of events: 71 
  Number of base moments: 710 
  ----
  
  Family: binomial 
  Link function: logit 
  
  Formula:
  event ~ s(ftime) + Z + offset(offset)
  
  Parametric coefficients:
              Estimate Std. Error z value Pr(>|z|)    
  (Intercept) -0.07544    0.21464  -0.351 0.725233    
  Z            0.93159    0.26600   3.502 0.000461 ***
  ---
  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      1  0.204   0.652
  
  R-sq.(adj) =  0.0148   Deviance explained = 2.91%
  UBRE = -0.40079  Scale est. = 1         n = 781
  Fitting smooth hazards with case-base sampling
  
  Sample size: 200 
  Number of events: 71 
  Number of base moments: 710 
  ----
  
  Family: binomial 
  Link function: logit 
  
  Formula:
  event ~ s(ftime) + Z + offset(offset)
  
  Parametric coefficients:
              Estimate Std. Error z value Pr(>|z|)    
  (Intercept) -0.09751    0.21515  -0.453 0.650402    
  Z            0.98372    0.26664   3.689 0.000225 ***
  ---
  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  1.001  0.021   0.886
  
  R-sq.(adj) =  0.0162   Deviance explained = 3.09%
  UBRE = -0.40185  Scale est. = 1         n = 781
  [ FAIL 1 | WARN 1 | SKIP 3 | PASS 235 ]
  
  ══ Skipped tests ═══════════════════════════════════════════════════════════════
  • gbm cannot be loaded (2)
  • gbm not implemented (1)
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Failure (test-absRiskComp.R:168:5): should output probabilities with data tables - two covariate profile ──
  all(absRiskMC <= 1) is not TRUE
  
  `actual`:   FALSE
  `expected`: TRUE 
  
  [ FAIL 1 | WARN 1 | SKIP 3 | PASS 235 ]
  Error: Test failures
  Execution halted