Running ‘testthat.R’ [45s/66s]
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: 71 
  Number of base moments: 7100 
  ----
  
  Call:
  fitSmoothHazard(formula = event ~ Z, data = DF, time = "ftime")
  
  Deviance Residuals: 
      Min       1Q   Median       3Q      Max  
  -0.1859  -0.1859  -0.1012  -0.1012   3.2490  
  
  Coefficients:
              Estimate Std. Error z value Pr(>|z|)    
  (Intercept)  -0.1843     0.2137  -0.862    0.388    
  Z             1.2233     0.2578   4.745 2.08e-06 ***
  ---
  Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
  
  (Dispersion parameter for binomial family taken to be 1)
  
      Null deviance: 796.64  on 7170  degrees of freedom
  Residual deviance: 771.81  on 7169  degrees of freedom
  AIC: 775.81
  
  Number of Fisher Scoring iterations: 8
  
  Fitting smooth hazards with case-base sampling
  
  Sample size: 200 
  Number of events: 71 
  Number of base moments: 7100 
  ----
  
  Call:
  fitSmoothHazard(formula = event ~ Z, data = DT, time = "ftime")
  
  Deviance Residuals: 
      Min       1Q   Median       3Q      Max  
  -0.1869  -0.1869  -0.1008  -0.1008   3.2512  
  
  Coefficients:
              Estimate Std. Error z value Pr(>|z|)    
  (Intercept)  -0.1915     0.2137  -0.896     0.37    
  Z             1.2416     0.2578   4.816 1.46e-06 ***
  ---
  Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
  
  (Dispersion parameter for binomial family taken to be 1)
  
      Null deviance: 796.64  on 7170  degrees of freedom
  Residual deviance: 771.05  on 7169  degrees of freedom
  AIC: 775.05
  
  Number of Fisher Scoring iterations: 8
  
  Fitting smooth hazards with case-base sampling
  
  Sample size: 200 
  Number of events: 80 
  Number of base moments: 800 
  ----
  
  Family: binomial 
  Link function: logit 
  
  Formula:
  event ~ s(ftime) + Z + offset(offset)
  
  Parametric coefficients:
               Estimate Std. Error z value Pr(>|z|)    
  (Intercept) -0.009476   0.199929  -0.047    0.962    
  Z            1.086684   0.258155   4.209 2.56e-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) 1.108  1.208  0.012   0.957
  
  R-sq.(adj) =  0.0219   Deviance explained = 3.95%
  UBRE = -0.40772  Scale est. = 1         n = 880
  Fitting smooth hazards with case-base sampling
  
  Sample size: 200 
  Number of events: 80 
  Number of base moments: 800 
  ----
  
  Family: binomial 
  Link function: logit 
  
  Formula:
  event ~ s(ftime) + Z + offset(offset)
  
  Parametric coefficients:
              Estimate Std. Error z value Pr(>|z|)    
  (Intercept) -0.03693    0.19949  -0.185    0.853    
  Z            1.13529    0.25691   4.419 9.91e-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.884   2.36  1.444   0.463
  
  R-sq.(adj) =  0.0276   Deviance explained = 4.95%
  UBRE = -0.41208  Scale est. = 1         n = 880
  Fitting smooth hazards with case-base sampling
  
  Sample size: 200 
  Number of events: 79 
  Number of base moments: 790 
  ----
          var rel.inf
  ftime ftime 88.3499
  Z         Z 11.6501
  Fitting smooth hazards with case-base sampling
  
  Sample size: 200 
  Number of events: 79 
  Number of base moments: 790 
  ----
          var  rel.inf
  ftime ftime 88.34452
  Z         Z 11.65548
  Conditions used in construction of plot
  trt: 0 / 1
  offset: 0
  ══ Skipped tests ═══════════════════════════════════════════════════════════════
  • On CRAN (1)
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Failure (test-absRiskComp.R:157:5): should output probabilities with data frames - two covariate profile ──
  all(absRiskMC <= 1) is not TRUE
  
  `actual`:   FALSE
  `expected`: TRUE 
  
  [ FAIL 1 | WARN 2 | SKIP 1 | PASS 257 ]
  Error: Test failures
  Execution halted