Running ‘testthat.R’ [51s/57s]
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: 84 
  Number of base moments: 8400 
  ----
  
  Call:
  fitSmoothHazard(formula = event ~ Z, data = DF, time = "ftime")
  
  Deviance Residuals: 
      Min       1Q   Median       3Q      Max  
  -0.1790  -0.1790  -0.1076  -0.1076   3.2107  
  
  Coefficients:
              Estimate Std. Error z value Pr(>|z|)    
  (Intercept)  0.09739    0.18623   0.523    0.601    
  Z            1.02224    0.23056   4.434 9.26e-06 ***
  ---
  Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
  
  (Dispersion parameter for binomial family taken to be 1)
  
      Null deviance: 942.51  on 8483  degrees of freedom
  Residual deviance: 921.55  on 8482  degrees of freedom
  AIC: 925.55
  
  Number of Fisher Scoring iterations: 8
  
  Fitting smooth hazards with case-base sampling
  
  Sample size: 200 
  Number of events: 84 
  Number of base moments: 8400 
  ----
  
  Call:
  fitSmoothHazard(formula = event ~ Z, data = DT, time = "ftime")
  
  Deviance Residuals: 
      Min       1Q   Median       3Q      Max  
  -0.1803  -0.1803  -0.1071  -0.1071   3.2139  
  
  Coefficients:
              Estimate Std. Error z value Pr(>|z|)    
  (Intercept)  0.08703    0.18623   0.467     0.64    
  Z            1.04798    0.23057   4.545 5.49e-06 ***
  ---
  Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
  
  (Dispersion parameter for binomial family taken to be 1)
  
      Null deviance: 942.51  on 8483  degrees of freedom
  Residual deviance: 920.47  on 8482  degrees of freedom
  AIC: 924.47
  
  Number of Fisher Scoring iterations: 8
  
  Fitting smooth hazards with case-base sampling
  
  Sample size: 200 
  Number of events: 69 
  Number of base moments: 690 
  ----
  
  Family: binomial 
  Link function: logit 
  
  Formula:
  event ~ s(ftime) + Z + offset(offset)
  
  Parametric coefficients:
              Estimate Std. Error z value Pr(>|z|)    
  (Intercept)  -0.2316     0.2298  -1.008    0.314    
  Z             1.3222     0.2872   4.604 4.14e-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.974  2.451  2.879   0.361
  
  R-sq.(adj) =  0.0341   Deviance explained = 6.02%
  UBRE = -0.41692  Scale est. = 1         n = 759
  Fitting smooth hazards with case-base sampling
  
  Sample size: 200 
  Number of events: 69 
  Number of base moments: 690 
  ----
  
  Family: binomial 
  Link function: logit 
  
  Formula:
  event ~ s(ftime) + Z + offset(offset)
  
  Parametric coefficients:
              Estimate Std. Error z value Pr(>|z|)    
  (Intercept)  -0.1930     0.2289  -0.843    0.399    
  Z             1.2124     0.2884   4.204 2.62e-05 ***
  ---
  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.045  2.535  4.003   0.218
  
  R-sq.(adj) =  0.0328   Deviance explained = 5.86%
  UBRE = -0.41577  Scale est. = 1         n = 759
  [ 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:106:5): should output probabilities with data frames ──
  all(absRiskMC[, -1] <= 1) is not TRUE
  
  `actual`:   FALSE
  `expected`: TRUE 
  
  [ FAIL 1 | WARN 1 | SKIP 3 | PASS 235 ]
  Error: Test failures
  Execution halted