Running ‘testthat.R’ [39s/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: 70 
  Number of base moments: 7000 
  ----
  
  Call:
  fitSmoothHazard(formula = event ~ Z, data = DF, time = "ftime")
  
  Deviance Residuals: 
      Min       1Q   Median       3Q      Max  
  -0.1691  -0.1691  -0.1180  -0.1180   3.1532  
  
  Coefficients:
              Estimate Std. Error z value Pr(>|z|)   
  (Intercept)   0.1119     0.1863   0.600  0.54826   
  Z             0.7238     0.2438   2.969  0.00299 **
  ---
  Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
  
  (Dispersion parameter for binomial family taken to be 1)
  
      Null deviance: 785.42  on 7069  degrees of freedom
  Residual deviance: 776.44  on 7068  degrees of freedom
  AIC: 780.44
  
  Number of Fisher Scoring iterations: 7
  
  Fitting smooth hazards with case-base sampling
  
  Sample size: 200 
  Number of events: 70 
  Number of base moments: 7000 
  ----
  
  Call:
  fitSmoothHazard(formula = event ~ Z, data = DT, time = "ftime")
  
  Deviance Residuals: 
      Min       1Q   Median       3Q      Max  
  -0.1689  -0.1689  -0.1181  -0.1181   3.1526  
  
  Coefficients:
              Estimate Std. Error z value Pr(>|z|)   
  (Intercept)   0.1135     0.1863   0.609  0.54225   
  Z             0.7197     0.2438   2.952  0.00316 **
  ---
  Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
  
  (Dispersion parameter for binomial family taken to be 1)
  
      Null deviance: 785.42  on 7069  degrees of freedom
  Residual deviance: 776.54  on 7068  degrees of freedom
  AIC: 780.54
  
  Number of Fisher Scoring iterations: 7
  
  Fitting smooth hazards with case-base sampling
  
  Sample size: 200 
  Number of events: 77 
  Number of base moments: 770 
  ----
  
  Family: binomial 
  Link function: logit 
  
  Formula:
  event ~ s(ftime) + Z + offset(offset)
  
  Parametric coefficients:
              Estimate Std. Error z value Pr(>|z|)    
  (Intercept)  -0.3345     0.2343  -1.428    0.153    
  Z             1.6322     0.2785   5.861 4.59e-09 ***
  ---
  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.452  1.778  1.914   0.441
  
  R-sq.(adj) =  0.0541   Deviance explained = 8.85%
  UBRE = -0.43652  Scale est. = 1         n = 847
  Fitting smooth hazards with case-base sampling
  
  Sample size: 200 
  Number of events: 77 
  Number of base moments: 770 
  ----
  
  Family: binomial 
  Link function: logit 
  
  Formula:
  event ~ s(ftime) + Z + offset(offset)
  
  Parametric coefficients:
              Estimate Std. Error z value Pr(>|z|)    
  (Intercept)  -0.3077     0.2340  -1.315    0.188    
  Z             1.5716     0.2772   5.670 1.42e-08 ***
  ---
  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  1.114   0.291
  
  R-sq.(adj) =  0.0499   Deviance explained = 8.12%
  UBRE = -0.43313  Scale est. = 1         n = 847
  ══ Skipped tests ═══════════════════════════════════════════════════════════════
  • gbm cannot be loaded (2)
  • gbm not implemented (1)
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Failure (test-absRiskComp.R:155:5): should output probabilities with data frames - 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