From e293f5a4fca844c555a972f9a0e27344d19e67e1 Mon Sep 17 00:00:00 2001 From: Kyle Belanger Date: Thu, 26 Jan 2023 15:39:24 -0500 Subject: [PATCH] book updates --- _quarto.yml | 2 ++ chapter3.qmd | 12 ++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/_quarto.yml b/_quarto.yml index 7d78e3d..a5a5489 100644 --- a/_quarto.yml +++ b/_quarto.yml @@ -29,6 +29,8 @@ format: default-image-extension: emf + + editor: visual diff --git a/chapter3.qmd b/chapter3.qmd index 780e320..ecdd791 100644 --- a/chapter3.qmd +++ b/chapter3.qmd @@ -27,27 +27,27 @@ A total of 18 variables were chosen for this study. The age and gender of the pa The unique patient id and chart time were also retained for identifying each sample. Each sample contains one set of 16 lab values for each patient. Patients may have several samples in the data set that were run at different times. Rows were retained as long as they had less than three missing results. These missing results can be filled in by imputation later in the process. Samples were also filtered for those with TSH above or below the reference range of 0.27 - 4.2 uIU/mL. These represent samples that would have reflexed for Free T4 testing. After filtering, the final data set contained `r nrow(ds1)` rows. -Once the final data set was collected, an additional column was created for the outcome variable to determine if the Free T4 value was diagnostic. After adding the outcome variable, the Free T4 value was dropped from each row. @tbl-outcome_var shows how the outcomes were added. @tbl-data_summary shows the summary statistics of each variable selected for the study. +Once the final data set was collected, an additional column was created for the outcome variable to determine if the Free T4 value was diagnostic. After adding the outcome variable, the Free T4 value was dropped from each row. @tbl-outcome_var shows how the outcomes were added | TSH Value | Free T4 Value | Outcome | |---------------|---------------|---------------------| | \>4.2 uIU/ml | \>0.93 ng/dL | Non-Hypothyroidism | | \>4.2 uIU/ml | \<0.93 ng/dL | Hypothyroidism | -| \<0.27 uIU/ml | \<1.7 ng/d | Non-Hyperthyroidism | -| \<0.27 uIU/ml | \>1.7 ng/d | Hyperthyroidism | +| \<0.27 uIU/ml | \<1.7 ng/dL | Non-Hyperthyroidism | +| \<0.27 uIU/ml | \>1.7 ng/dL | Hyperthyroidism | : Outcome Variable {#tbl-outcome_var} +. @tbl-data_summary shows the summary statistics of each variable selected for the study. Each numeric variable is listed with the percent missing, median, and interquartile range (IQR). The data set is weighted toward elevated TSH levels, with 80% of values falling into that category. Glucose and Calcium both have high amounts of missing values at `r gtsummary::inline_text(summary_tbl, variable = GLU, column = n)` and `r gtsummary::inline_text(summary_tbl, variable = CA, column = n)`, respectively. + ```{r} #| label: tbl-data_summary #| tbl-cap: Data Summary #| echo: false -summary_tbl %>% gtsummary$as_kable_extra() +summary_tbl %>% gtsummary$as_kable() ``` -`r gtsummary::inline_text(summary_tbl, variable = CO2, column = n)` - ## Data Inspection ![Distribution of Variables](figures/distrubution_histo){#fig-distro_histo}