- using R version 4.4.2 (2024-10-31)
- using platform: x86_64-pc-linux-gnu
- R was compiled by
gcc-14 (Debian 14.2.0-6) 14.2.0
GNU Fortran (Debian 14.2.0-6) 14.2.0
- running under: Debian GNU/Linux trixie/sid
- using session charset: UTF-8
- checking for file ‘aplore3/DESCRIPTION’ ... OK
- this is package ‘aplore3’ version ‘0.9’
- checking package namespace information ... OK
- checking package dependencies ... NOTE
Package suggested but not available for checking: ‘pROC’
- checking if this is a source package ... OK
- checking if there is a namespace ... OK
- checking for executable files ... OK
- checking for hidden files and directories ... OK
- checking for portable file names ... OK
- checking for sufficient/correct file permissions ... OK
- checking serialization versions ... OK
- checking whether package ‘aplore3’ can be installed ... OK
See the install log for details.
- checking package directory ... OK
- checking for future file timestamps ... OK
- checking ‘build’ directory ... OK
- checking DESCRIPTION meta-information ... OK
- checking top-level files ... OK
- checking for left-over files ... OK
- checking index information ... OK
- checking package subdirectories ... OK
- checking code files for non-ASCII characters ... OK
- checking R files for syntax errors ... OK
- checking whether the package can be loaded ... [0s/0s] OK
- checking whether the package can be loaded with stated dependencies ... [0s/0s] OK
- checking whether the package can be unloaded cleanly ... [0s/0s] OK
- checking whether the namespace can be loaded with stated dependencies ... [0s/0s] OK
- checking whether the namespace can be unloaded cleanly ... [0s/0s] OK
- checking loading without being on the library search path ... [0s/0s] OK
- checking use of S3 registration ... OK
- checking dependencies in R code ... OK
- checking S3 generic/method consistency ... OK
- checking replacement functions ... OK
- checking foreign function calls ... OK
- checking R code for possible problems ... [2s/4s] OK
- checking Rd files ... [0s/1s] OK
- checking Rd metadata ... OK
- checking Rd line widths ... OK
- checking Rd cross-references ... OK
- checking for missing documentation entries ... OK
- checking for code/documentation mismatches ... OK
- checking Rd \usage sections ... OK
- checking Rd contents ... OK
- checking for unstated dependencies in examples ... OK
- checking contents of ‘data’ directory ... OK
- checking data for non-ASCII characters ... [0s/1s] OK
- checking LazyData ... OK
- checking data for ASCII and uncompressed saves ... OK
- checking sizes of PDF files under ‘inst/doc’ ... OK
- checking installed files from ‘inst/doc’ ... OK
- checking files in ‘vignettes’ ... OK
- checking examples ... [3s/4s] ERROR
Running examples in ‘aplore3-Ex.R’ failed
The error most likely occurred in:
> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: glow500
> ### Title: GLOW500 data
> ### Aliases: glow500
> ### Keywords: datasets
>
> ### ** Examples
>
> head(glow500, n = 10)
sub_id site_id phy_id priorfrac age weight height bmi premeno momfrac
1 1 1 14 No 62 70.3 158 28.16055 No No
2 2 4 284 No 65 87.1 160 34.02344 No No
3 3 6 305 Yes 88 50.8 157 20.60936 No Yes
4 4 6 309 No 82 62.1 160 24.25781 No No
5 5 1 37 No 61 68.0 152 29.43213 No No
6 6 5 299 Yes 67 68.0 161 26.23356 No No
7 7 5 302 No 84 50.8 150 22.57778 No No
8 8 1 36 Yes 82 40.8 153 17.42919 No No
9 9 1 8 Yes 86 62.6 156 25.72321 No No
10 10 4 282 No 58 63.5 166 23.04398 No No
armassist smoke raterisk fracscore fracture
1 No No Same 1 No
2 No No Same 2 No
3 Yes No Less 11 No
4 No No Less 5 No
5 No No Same 1 No
6 No Yes Same 4 No
7 No No Less 6 No
8 No No Same 7 No
9 No No Same 7 No
10 No No Less 0 No
> summary(glow500)
sub_id site_id phy_id priorfrac age
Min. : 1.0 Min. :1.000 Min. : 1.00 No :374 Min. :55.00
1st Qu.:125.8 1st Qu.:2.000 1st Qu.: 57.75 Yes:126 1st Qu.:61.00
Median :250.5 Median :3.000 Median :182.50 Median :67.00
Mean :250.5 Mean :3.436 Mean :178.55 Mean :68.56
3rd Qu.:375.2 3rd Qu.:5.000 3rd Qu.:298.00 3rd Qu.:76.00
Max. :500.0 Max. :6.000 Max. :325.00 Max. :90.00
weight height bmi premeno momfrac armassist
Min. : 39.90 Min. :134.0 Min. :14.88 No :403 No :435 No :312
1st Qu.: 59.90 1st Qu.:157.0 1st Qu.:23.27 Yes: 97 Yes: 65 Yes:188
Median : 68.00 Median :161.5 Median :26.42
Mean : 71.82 Mean :161.4 Mean :27.55
3rd Qu.: 81.30 3rd Qu.:165.0 3rd Qu.:30.79
Max. :127.00 Max. :199.0 Max. :49.08
smoke raterisk fracscore fracture
No :465 Less :167 Min. : 0.000 No :375
Yes: 35 Same :186 1st Qu.: 2.000 Yes:125
Greater:147 Median : 3.000
Mean : 3.698
3rd Qu.: 5.000
Max. :11.000
>
> ## Table 2.2 p. 39
> summary(mod2.2 <- glm(fracture ~ age + weight + priorfrac +
+ premeno + raterisk,
+ family = binomial,
+ data = glow500))
Call:
glm(formula = fracture ~ age + weight + priorfrac + premeno +
raterisk, family = binomial, data = glow500)
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -5.605794 1.220668 -4.592 4.38e-06 ***
age 0.050142 0.013417 3.737 0.000186 ***
weight 0.004080 0.006926 0.589 0.555803
priorfracYes 0.679457 0.242384 2.803 0.005059 **
premenoYes 0.186958 0.276710 0.676 0.499266
rateriskSame 0.534493 0.275858 1.938 0.052676 .
rateriskGreater 0.874123 0.289157 3.023 0.002503 **
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 562.34 on 499 degrees of freedom
Residual deviance: 518.08 on 493 degrees of freedom
AIC: 532.08
Number of Fisher Scoring iterations: 4
>
> ## Table 2.3 p. 40
> summary(mod2.3 <- update(mod2.2, . ~ . - weight - premeno))
Call:
glm(formula = fracture ~ age + priorfrac + raterisk, family = binomial,
data = glow500)
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -4.99060 0.90270 -5.529 3.23e-08 ***
age 0.04591 0.01244 3.690 0.000224 ***
priorfracYes 0.70023 0.24116 2.904 0.003689 **
rateriskSame 0.54856 0.27501 1.995 0.046075 *
rateriskGreater 0.86576 0.28621 3.025 0.002487 **
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 562.34 on 499 degrees of freedom
Residual deviance: 518.90 on 495 degrees of freedom
AIC: 528.9
Number of Fisher Scoring iterations: 4
>
> ## Table 2.4 p. 44
> vcov(mod2.3)
(Intercept) age priorfracYes rateriskSame
(Intercept) 0.81486728 -0.0108886686 0.0445010519 -0.0603876325
age -0.01088867 0.0001547891 -0.0008344776 0.0002239259
priorfracYes 0.04450105 -0.0008344776 0.0581588491 -0.0031271822
rateriskSame -0.06038763 0.0002239259 -0.0031271822 0.0756289050
rateriskGreater -0.08055123 0.0005370070 -0.0118441110 0.0462406814
rateriskGreater
(Intercept) -0.080551235
age 0.000537007
priorfracYes -0.011844111
rateriskSame 0.046240681
rateriskGreater 0.081913370
>
> ## Table 3.6 p. 58
> contrasts(glow500$raterisk)
Same Greater
Less 0 0
Same 1 0
Greater 0 1
>
> ## Contrasts: Table 3.8 and 3.9 p. 60
> contrasts(glow500$raterisk) <- matrix(c(-1,-1,1,0,0,1), byrow= TRUE, ncol = 2)
> summary(mod3.9 <- glm(fracture ~ raterisk, family = binomial,
+ data = glow500))
Call:
glm(formula = fracture ~ raterisk, family = binomial, data = glow500)
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -1.1172 0.1062 -10.514 < 2e-16 ***
raterisk1 0.0611 0.1437 0.425 0.67067
raterisk2 0.4240 0.1466 2.892 0.00383 **
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 562.34 on 499 degrees of freedom
Residual deviance: 550.58 on 497 degrees of freedom
AIC: 556.58
Number of Fisher Scoring iterations: 4
> # cleaning modified dataset ...
> rm(glow500)
>
> ## Table 5.1 pg 160 - Hosmer-Lemeshow test (with vcdExtra package)
> mod4.16 <- glm(fracture ~ age * priorfrac + height + momfrac * armassist +
+ I(as.integer(raterisk) == 3) ,
+ family = binomial,
+ data = glow500)
> library(vcdExtra)
Loading required package: vcd
Loading required package: grid
Loading required package: gnm
> summary(HLtest(mod4.16))
Partition for Hosmer and Lemeshow Goodness-of-Fit Test
cut total obs exp chi
1 [0.0209,0.0847] 50 47 46.68709 0.04579536
2 (0.0847,0.111] 50 46 45.13980 0.12803215
3 (0.111,0.141] 50 43 43.72511 -0.10965679
4 (0.141,0.176] 51 40 42.92385 -0.44627785
5 (0.176,0.208] 49 42 39.60399 0.38073192
6 (0.208,0.249] 50 37 38.60188 -0.25782525
7 (0.249,0.322] 50 41 35.73499 0.88075020
8 (0.322,0.388] 50 31 32.37786 -0.24214783
9 (0.388,0.482] 50 25 28.18856 -0.60056317
10 (0.482,0.747] 50 23 22.01688 0.20952147
Hosmer and Lemeshow Goodness-of-Fit Test
Call:
glm(formula = fracture ~ age * priorfrac + height + momfrac *
armassist + I(as.integer(raterisk) == 3), family = binomial,
data = glow500)
ChiSquare df P_value
6.391925 8 0.6034186
>
> ## Table 5.3 p. 171 - Classification table
> glow500$pred4.16 <- predict(mod4.16, type = "response")
> with(glow500, addmargins(table( pred4.16 > 0.5, fracture)))
fracture
No Yes Sum
FALSE 356 103 459
TRUE 19 22 41
Sum 375 125 500
>
> ## Sensitivy, specificity, ROC (using pROC)
> library(pROC)
Error in library(pROC) : there is no package called ‘pROC’
Execution halted
- checking for unstated dependencies in vignettes ... OK
- checking package vignettes ... OK
- checking re-building of vignette outputs ... [4s/5s] ERROR
Error(s) in re-building vignettes:
...
--- re-building ‘aplore3-examples.Rnw’ using knitr
\chapter{\texttt{glow} datasets}
\section{\texttt{glow500}}
Quitting from lines 5-6 [unnamed-chunk-15] (./ch/glow.Rnw)
Quitting from lines 28-50 (aplore3-examples.Rnw)
Error: processing vignette 'aplore3-examples.Rnw' failed with diagnostics:
there is no package called 'pROC'
--- failed re-building ‘aplore3-examples.Rnw’
SUMMARY: processing the following file failed:
‘aplore3-examples.Rnw’
Error: Vignette re-building failed.
Execution halted
- checking PDF version of manual ... [5s/7s] OK
- checking HTML version of manual ... [1s/1s] OK
- checking for non-standard things in the check directory ... OK
- DONE
Status: 2 ERRORs, 1 NOTE