Last updated: 2022-11-30

Checks: 7 0

Knit directory: ampel-leipzig-meld/

This reproducible R Markdown analysis was created with workflowr (version 1.7.0). The Checks tab describes the reproducibility checks that were applied when the results were created. The Past versions tab lists the development history.


Great! Since the R Markdown file has been committed to the Git repository, you know the exact version of the code that produced these results.

Great job! The global environment was empty. Objects defined in the global environment can affect the analysis in your R Markdown file in unknown ways. For reproduciblity it’s best to always run the code in an empty environment.

The command set.seed(20210604) was run prior to running the code in the R Markdown file. Setting a seed ensures that any results that rely on randomness, e.g. subsampling or permutations, are reproducible.

Great job! Recording the operating system, R version, and package versions is critical for reproducibility.

Nice! There were no cached chunks for this analysis, so you can be confident that you successfully produced the results during this run.

Great job! Using relative paths to the files within your workflowr project makes it easier to run your code on other machines.

Great! You are using Git for version control. Tracking code development and connecting the code version to the results is critical for reproducibility.

The results in this page were generated with repository version e1aebf7. See the Past versions tab to see a history of the changes made to the R Markdown and HTML files.

Note that you need to be careful to ensure that all relevant files for the analysis have been committed to Git prior to generating the results (you can use wflow_publish or wflow_git_commit). workflowr only checks the R Markdown file, but you know if there are other scripts or data files that it depends on. Below is the status of the Git repository when the results were generated:


Ignored files:
    Ignored:    _targets/
    Ignored:    analysis/article.md
    Ignored:    container/
    Ignored:    logs/
    Ignored:    scripts/R.sh

Untracked files:
    Untracked:  analysis/bibliography/bibliography.bib.sav.tmp
    Untracked:  submission/

Note that any generated files, e.g. HTML, png, CSS, etc., are not included in this status report because it is ok for generated content to have uncommitted changes.


These are the previous versions of the repository in which changes were made to the R Markdown (analysis/missing.Rmd) and HTML (docs/missing.html) files. If you’ve configured a remote Git repository (see ?wflow_git_remote), click on the hyperlinks in the table below to view the files as they were in that past version.

File Version Author Date Message
html 65d58c4 Sebastian Gibb 2022-07-18 chore: rebuild site
html fb43d01 Sebastian Gibb 2022-06-19 chore: rebuild site
html ebe29cf Sebastian Gibb 2022-06-16 chore: rebuild site
html 8035219 Sebastian Gibb 2022-06-15 chore: rebuild site
html d3e9462 Sebastian Gibb 2022-06-06 chore: rebuild site
html b20484a Sebastian Gibb 2022-06-06 chore: rebuild site
html 983ec69 Sebastian Gibb 2022-03-17 chore: rebuild site
html 373e7d8 Sebastian Gibb 2021-10-20 chore: rebuild site
html df8964f Sebastian Gibb 2021-10-15 chore: rebuild site
html c66640c Sebastian Gibb 2021-09-14 feat: first nnet tests
html afa48d9 Sebastian Gibb 2021-08-07 chore: rebuild site
Rmd 4478f6a Sebastian Gibb 2021-08-02 Revert "fix: working directory for targets"
Rmd cac14f6 Sebastian Gibb 2021-08-02 fix: working directory for targets
Rmd 3957af7 Sebastian Gibb 2021-08-02 refactor: move common yaml headers into _site.yml
html 3aab3e1 Sebastian Gibb 2021-08-01 chore: rebuild site
html 3810a79 Sebastian Gibb 2021-07-15 chore: rebuild site
html 2869556 Sebastian Gibb 2021-07-02 chore: rebuild site
html d9c37ec Sebastian Gibb 2021-07-02 chore: rebuild site
Rmd 1c823ad Sebastian Gibb 2021-07-02 fix: load missing ameld package
Rmd 7e919c9 Sebastian Gibb 2021-07-02 refactor: use ameld::plot_dots
html 81fcc75 Sebastian Gibb 2021-06-11 chore: rebuild site
html 783c49f Sebastian Gibb 2021-06-11 chore: rebuild site
html aac7ea8 Sebastian Gibb 2021-06-11 chore: rebuild site
html 6541fae Sebastian Gibb 2021-06-11 fix: add targets for missing/corrplot
Rmd 76196cb Sebastian Gibb 2021-06-11 fix: wrong plot call
Rmd ecd9fde Sebastian Gibb 2021-06-11 feat: plot missing values
Rmd 851d2e1 Sebastian Gibb 2021-06-11 feat: add missing data overview

library("targets")
library("ameld")
Loading required package: glmnet
Loading required package: Matrix
Loaded glmnet 4.1-4
Loading required package: survival

Attaching package: 'ameld'
The following object is masked from 'package:survival':

    basehaz
tar_load(raw_data)

.image <- function(x, col = c("white", palette.colors(2L)[2L])) {
    old.par <- par(no.readonly = TRUE)
    on.exit(par(old.par))

    nr <- nrow(x)
    nc <- ncol(x)
    nms <- colnames(x)

    mai <- par("mai")
    w <- max(strwidth(nms, "inch"), na.rm = TRUE) + 1/16
    if (mai[2L] < w)
        mai[2L] <- mai[4L] + w # taken from dotchart
    par(mai = mai)

    y <- seq_len(nc)
    image(
        1L:nr, y, x[, rev(y)], col = col,
        xlim = 0.5 + c(0L, nr), ylim = 0.5 + c(0L, nc),
        axes = FALSE, xlab = "", ylab = ""
    )
    title(main = "Missing Data", adj = 0L)
    title(xlab = "Rows", adj = 1L)
    mtext(
        rev(nms), at = y, adj = 0L, side = 2L, las = 2L,
        line = (w + 0.1) / par("csi"), cex = 0.75
    )
    abline(h = y, col = "#808080", lty = "dotted", lwd = 1L)
}

1 Missing Data

m <- raw_data
m$Sex <- as.numeric(m$Sex)
m <- as.matrix(m)
mna <- is.na(m)
mode(mna) <- "numeric"
tbl <- colSums(mna)
na <- sort(tbl[tbl > 0L], decreasing = TRUE)
knitr::kable(
    cbind(na, round(colMeans(mna[, names(na)]) * 100, 2)),
    col.names = c("# Missing Data", "% of Missing Data")
)
# Missing Data % of Missing Data
BILID_S 82 12.54
B_MPV_E 64 9.79
IL6_S 56 8.56
VDT_OH_S 47 7.19
B_PLT_E 26 3.98
B_WBC_E 23 3.52
CRP_S 14 2.14
ALAT_S 10 1.53
NA_S 9 1.38
ASAT_S 8 1.22
PTH_S 8 1.22
AP_S 7 1.07
CYSC_S 7 1.07
ALB_S 6 0.92
CHE_S 6 0.92
GGT_S 6 0.92
PROT_S 6 0.92
PALB_S 5 0.76
Dialysis 2 0.31
INR_C 2 0.31
Cirrhosis 1 0.15
SBP 1 0.15
CA_S 1 0.15
CL_S 1 0.15
P_S 1 0.15
plot_dots(sort(na), xlim = c(0L, nrow(m)), main = "Missing Data")

Version Author Date
d9c37ec Sebastian Gibb 2021-07-02
6541fae Sebastian Gibb 2021-06-11
.image(mna)

Version Author Date
6541fae Sebastian Gibb 2021-06-11

sessionInfo()
R version 4.2.0 (2022-04-22)
Platform: x86_64-unknown-linux-gnu (64-bit)

Matrix products: default
BLAS/LAPACK: /gnu/store/ras6dprsw3wm3swk23jjp8ww5dwxj333-openblas-0.3.18/lib/libopenblasp-r0.3.18.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] ameld_0.0.30   survival_3.3-1 glmnet_4.1-4   Matrix_1.4-1   targets_0.12.1

loaded via a namespace (and not attached):
 [1] shape_1.4.6       tidyselect_1.1.2  xfun_0.31         bslib_0.3.1      
 [5] purrr_0.3.4       splines_4.2.0     lattice_0.20-45   vctrs_0.4.1      
 [9] htmltools_0.5.2   yaml_2.3.5        utf8_1.2.2        rlang_1.0.2      
[13] jquerylib_0.1.4   later_1.3.0       pillar_1.7.0      glue_1.6.2       
[17] withr_2.5.0       foreach_1.5.2     lifecycle_1.0.1   stringr_1.4.0    
[21] workflowr_1.7.0   codetools_0.2-18  evaluate_0.15     knitr_1.39       
[25] callr_3.7.0       fastmap_1.1.0     httpuv_1.6.5      ps_1.7.0         
[29] fansi_1.0.3       highr_0.9         Rcpp_1.0.8.3      promises_1.2.0.1 
[33] backports_1.4.1   jsonlite_1.8.0    fs_1.5.2          digest_0.6.29    
[37] stringi_1.7.6     bookdown_0.26     processx_3.5.3    rprojroot_2.0.3  
[41] grid_4.2.0        cli_3.3.0         tools_4.2.0       magrittr_2.0.3   
[45] base64url_1.4     sass_0.4.1        tibble_3.1.7      crayon_1.5.1     
[49] whisker_0.4       pkgconfig_2.0.3   ellipsis_0.3.2    data.table_1.14.2
[53] rmarkdown_2.14    iterators_1.0.14  R6_2.5.1          igraph_1.3.1     
[57] git2r_0.30.1      compiler_4.2.0