This document will load the Hmisc and knitr R packages.

FEV Dataset

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.

Variables

  • ID variable
    • id
  • Categorical variables
    • sex
    • smoke
  • Continuous variables
    • fev
    • height
  • Discrete variables
    • age

Descriptive Statistics

d

6 Variables   654 Observations

id
image
nmissingdistinctInfoMeanGmd.05.10.25.50.75.90.95
654065413717027213 3142 61621581136071536387334277706
lowest : 201 202 301 341 351 , highest: 83841 83901 83951 83952 90001
ageyears
image
nmissingdistinctInfoMeanGmd.05.10.25.50.75.90.95
6540170.9889.9313.3 5 6 810121415
lowest : 3 4 5 6 7 , highest: 15 16 17 18 19
 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
 

fevliters
image
nmissingdistinctInfoMeanGmd.05.10.25.50.75.90.95
654057512.6370.96811.4451.6121.9812.5473.1193.8134.289
lowest : 0.791 0.796 0.839 1.004 1.072 , highest: 5.102 5.224 5.633 5.638 5.793
heightinches
image
nmissingdistinctInfoMeanGmd.05.10.25.50.75.90.95
6540560.99961.146.49751.053.057.061.565.568.570.0
lowest : 46.0 46.5 47.0 48.0 49.0 , highest: 72.0 72.5 73.0 73.5 74.0
sex
nmissingdistinct
65402
 Value      female   male
 Frequency     318    336
 Proportion  0.486  0.514
 

smoke
nmissingdistinct
65402
 Value      non-current smoker     current smoker
 Frequency                 589                 65
 Proportion              0.901              0.099
 

Inline Equation

The mean age is \(\mu =\) 9.9311927. (the LaTeX equation used here is \mu =)

Simple Table

current smoker non-current smoker
65 589

Automatic Table

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

Computing Environment

 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-45
 
To 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.