Running ‘testthat.R’ [40s/59s]
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: 68 
  Number of base moments: 6800 
  ----
  
  Call:
  fitSmoothHazard(formula = event ~ Z, data = DF, time = "ftime")
  
  Deviance Residuals: 
      Min       1Q   Median       3Q      Max  
  -0.2010  -0.2010  -0.0795  -0.0795   3.3936  
  
  Coefficients:
              Estimate Std. Error z value Pr(>|z|)    
  (Intercept)  -0.5344     0.2778  -1.924   0.0544 .  
  Z             1.8632     0.3094   6.022 1.72e-09 ***
  ---
  Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
  
  (Dispersion parameter for binomial family taken to be 1)
  
      Null deviance: 762.98  on 6867  degrees of freedom
  Residual deviance: 714.89  on 6866  degrees of freedom
  AIC: 718.89
  
  Number of Fisher Scoring iterations: 8
  
  Fitting smooth hazards with case-base sampling
  
  Sample size: 200 
  Number of events: 68 
  Number of base moments: 6800 
  ----
  
  Call:
  fitSmoothHazard(formula = event ~ Z, data = DT, time = "ftime")
  
  Deviance Residuals: 
      Min       1Q   Median       3Q      Max  
  -0.2014  -0.2014  -0.0794  -0.0794   3.3943  
  
  Coefficients:
              Estimate Std. Error z value Pr(>|z|)    
  (Intercept)  -0.5368     0.2778  -1.933   0.0533 .  
  Z             1.8693     0.3094   6.042 1.52e-09 ***
  ---
  Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
  
  (Dispersion parameter for binomial family taken to be 1)
  
      Null deviance: 762.98  on 6867  degrees of freedom
  Residual deviance: 714.54  on 6866  degrees of freedom
  AIC: 718.54
  
  Number of Fisher Scoring iterations: 8
  
  Fitting smooth hazards with case-base sampling
  
  Sample size: 200 
  Number of events: 74 
  Number of base moments: 740 
  ----
  
  Family: binomial 
  Link function: logit 
  
  Formula:
  event ~ s(ftime) + Z + offset(offset)
  
  Parametric coefficients:
              Estimate Std. Error z value Pr(>|z|)    
  (Intercept)  -0.1796     0.3593  -0.500    0.617    
  Z             1.0999     0.2668   4.122 3.75e-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) 5.685   6.61  6.763   0.387
  
  R-sq.(adj) =  0.0326   Deviance explained = 7.13%
  UBRE = -0.41529  Scale est. = 1         n = 814
  Fitting smooth hazards with case-base sampling
  
  Sample size: 200 
  Number of events: 74 
  Number of base moments: 740 
  ----
  
  Family: binomial 
  Link function: logit 
  
  Formula:
  event ~ s(ftime) + Z + offset(offset)
  
  Parametric coefficients:
              Estimate Std. Error z value Pr(>|z|)    
  (Intercept) -0.02888    0.22300  -0.129    0.897    
  Z            1.17343    0.26650   4.403 1.07e-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) 3.753  4.674  5.603   0.281
  
  R-sq.(adj) =  0.0338   Deviance explained = 6.81%
  UBRE = -0.41806  Scale est. = 1         n = 814
  ══ 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