This document will load the Hmisc
and knitr
R packages.
The “FEV” dataset is one of several ready-to-use datasets on the Vanderbilt Department of Biostatistics dataset repository. It can be retrieved with the getHdata
function.
n | missing | distinct | Info | Mean | Gmd | .05 | .10 | .25 | .50 | .75 | .90 | .95 |
---|---|---|---|---|---|---|---|---|---|---|---|---|
654 | 0 | 654 | 1 | 37170 | 27213 | 3142 | 6162 | 15811 | 36071 | 53638 | 73342 | 77706 |
n | missing | distinct | Info | Mean | Gmd | .05 | .10 | .25 | .50 | .75 | .90 | .95 |
---|---|---|---|---|---|---|---|---|---|---|---|---|
654 | 0 | 17 | 0.988 | 9.931 | 3.3 | 5 | 6 | 8 | 10 | 12 | 14 | 15 |
Value 3 4 5 6 7 8 9 10 11 12 13 14 Frequency 2 9 28 37 54 85 94 81 90 57 43 25 Proportion 0.003 0.014 0.043 0.057 0.083 0.130 0.144 0.124 0.138 0.087 0.066 0.038 Value 15 16 17 18 19 Frequency 19 13 8 6 3 Proportion 0.029 0.020 0.012 0.009 0.005
n | missing | distinct | Info | Mean | Gmd | .05 | .10 | .25 | .50 | .75 | .90 | .95 |
---|---|---|---|---|---|---|---|---|---|---|---|---|
654 | 0 | 575 | 1 | 2.637 | 0.9681 | 1.445 | 1.612 | 1.981 | 2.547 | 3.119 | 3.813 | 4.289 |
n | missing | distinct | Info | Mean | Gmd | .05 | .10 | .25 | .50 | .75 | .90 | .95 |
---|---|---|---|---|---|---|---|---|---|---|---|---|
654 | 0 | 56 | 0.999 | 61.14 | 6.497 | 51.0 | 53.0 | 57.0 | 61.5 | 65.5 | 68.5 | 70.0 |
n | missing | distinct |
---|---|---|
654 | 0 | 2 |
Value female male Frequency 318 336 Proportion 0.486 0.514
n | missing | distinct |
---|---|---|
654 | 0 | 2 |
Value non-current smoker current smoker Frequency 589 65 Proportion 0.901 0.099
The mean age is \(\mu =\) 9.9311927. (the LaTeX equation used here is \mu =
)
current smoker | non-current smoker |
---|---|
65 | 589 |
with(d, table(sex, smoke))
## smoke
## sex non-current smoker current smoker
## female 279 39
## male 310 26
Wrap code with the kable
function in the knitr
package to produce a better looking table.
non-current smoker | current smoker | |
---|---|---|
female | 279 | 39 |
male | 310 | 26 |
R version 4.2.0 (2022-04-22) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Ubuntu 18.04.6 LTS Matrix products: default BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.7.1 LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.7.1 attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] knitr_1.36 Hmisc_4.7-0 ggplot2_3.3.5 Formula_1.2-3 survival_3.2-13 lattice_0.20-45To cite R in publications use:
R Core Team (2022). R: A Language and Environment for Statistical Computing. R Foundation for Statistical Computing, Vienna, Austria. https://www.R-project.org/.
To cite the Hmisc package in publications use:Harrell Jr F (2022). Hmisc: Harrell Miscellaneous. R package version 4.7-0, https://CRAN.R-project.org/package=Hmisc.
To cite the ggplot2 package in publications use:Wickham H (2016). ggplot2: Elegant Graphics for Data Analysis. Springer-Verlag New York. ISBN 978-3-319-24277-4, https://ggplot2.tidyverse.org.
To cite the survival package in publications use:Therneau T (2021). A Package for Survival Analysis in R. R package version 3.2-13, https://CRAN.R-project.org/package=survival.