diff --git a/cran-comments.md b/cran-comments.md index 9f3c27e..7204630 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -8,15 +8,13 @@ ## R CMD check results -0 errors | 0 warnings | 1 note - -Maintainer: ‘Gorka Navarrete ’ - -Size of tarball: 6242682 bytes +0 errors | 0 warnings | 0 note ## New major version +Resending to reduce the tarball size below 5 MB as requestes by CRAN. Sorry! + This is a new version refactoring the way we calculate the PPV and NPV matrices. I also added parameters to control the scales, and multiple checks and tests. diff --git a/docs/articles/introduction.html b/docs/articles/introduction.html index d5fc1ae..c8d174b 100644 --- a/docs/articles/introduction.html +++ b/docs/articles/introduction.html @@ -79,7 +79,7 @@

Introduction to BayesianReasoning

Gorka Navarrete

-

2021-12-20

+

2021-12-21

Source: vignettes/introduction.Rmd
introduction.Rmd
@@ -88,8 +88,14 @@

2021-12-20

-

Bayesian reasoning in medical contexts +

Bayesian reasoning

+ +

CRAN status Codecov test coverage downloads Lifecycle: experimental DOI

+
+
+

Bayesian reasoning in medical contexts +

This package includes a few functions to plot and help understand Positive and Negative Predictive Values, and their relationship with Sensitivity, Specificity and Prevalence.

  • The Positive Predictive Value of a medical test is the probability that a positive result will mean having the disease. Formally p(Disease|+)
  • @@ -108,6 +114,7 @@

    Bayesian reasoning in medical co

    If you want to install the package can use: remotes::install_github("gorkang/BayesianReasoning"). Please report any problems you find in the Issues Github page.

    There is a shiny app implementation with most of the main features available.


    +

PPV_heatmap()

@@ -127,12 +134,9 @@

PPV_heatmap() PPV_heatmap(min_Prevalence = 1, max_Prevalence = 1000, - Sensitivity = 100, - Language = "en") -#> Warning in process_variables(min_Prevalence = min_Prevalence, max_Prevalence -#> = max_Prevalence, : * Specificity and limits_Specificity are NULL. Setting -#> Specificity = 95 and limits_Specificity = c(90, 100)

-

+ Sensitivity = 100, limits_Specificity = c(90, 100), + Language = "en")
+


NPV @@ -141,14 +145,10 @@

NPV
 
 PPV_heatmap(PPV_NPV = "NPV",
-            min_Prevalence = 800,
-            max_Prevalence = 1000, 
-            Specificity = 95, 
-            Language = "en")
-#> Warning in process_variables(min_Prevalence = min_Prevalence, max_Prevalence
-#> = max_Prevalence, : * Sensitivity and limits_Specificity are NULL. Setting
-#> Sensitivity = 95 and limits_Sensitivity = c(90, 100)
-

+ min_Prevalence = 800, max_Prevalence = 1000, + Specificity = 95, limits_Sensitivity = c(90, 100), + Language = "en")

+


@@ -167,7 +167,7 @@

Area overlay= 4.8, overlay_prevalence_1 = 1, overlay_prevalence_2 = 68)

-

+

The area plot overlay can show more details about how the calculation of PPV/NPV is performed:

 
@@ -181,7 +181,7 @@ 

Area overlay= 4.8, overlay_prevalence_1 = 1, overlay_prevalence_2 = 68)

-

+

Line overlay @@ -198,7 +198,7 @@

Line overlay= c(6.5, 7, 8, 9, 12, 14, 14), overlay_prevalence_1 = c(1, 1, 1, 1, 1, 1, 1), overlay_prevalence_2 = c(22, 26, 29, 44, 69, 227, 1667))

-

+


Another example. In this case, the FP is constant across age:

@@ -211,7 +211,7 @@ 

Line overlay= c(4.8, 4.8, 4.8), overlay_prevalence_1 = c(1, 1, 1), overlay_prevalence_2 = c(68, 626, 1068))

-

+


@@ -226,7 +226,7 @@

PPV_diagnostic_vs_screening()= 100, prevalence_screening_group = 1000, prevalence_diagnostic_group = 2) -

+


diff --git a/docs/articles/introduction_files/accessible-code-block-0.0.1/empty-anchor.js b/docs/articles/introduction_files/accessible-code-block-0.0.1/empty-anchor.js deleted file mode 100644 index ca349fd..0000000 --- a/docs/articles/introduction_files/accessible-code-block-0.0.1/empty-anchor.js +++ /dev/null @@ -1,15 +0,0 @@ -// Hide empty tag within highlighted CodeBlock for screen reader accessibility (see https://github.com/jgm/pandoc/issues/6352#issuecomment-626106786) --> -// v0.0.1 -// Written by JooYoung Seo (jooyoung@psu.edu) and Atsushi Yasumoto on June 1st, 2020. - -document.addEventListener('DOMContentLoaded', function() { - const codeList = document.getElementsByClassName("sourceCode"); - for (var i = 0; i < codeList.length; i++) { - var linkList = codeList[i].getElementsByTagName('a'); - for (var j = 0; j < linkList.length; j++) { - if (linkList[j].innerHTML === "") { - linkList[j].setAttribute('aria-hidden', 'true'); - } - } - } -}); diff --git a/docs/articles/introduction_files/figure-html/NPV-heatmap-1.png b/docs/articles/introduction_files/figure-html/NPV-heatmap-1.png index 4e045d2..196c165 100644 Binary files a/docs/articles/introduction_files/figure-html/NPV-heatmap-1.png and b/docs/articles/introduction_files/figure-html/NPV-heatmap-1.png differ diff --git a/docs/articles/introduction_files/figure-html/area-1.png b/docs/articles/introduction_files/figure-html/area-1.png index 437327e..3e5949a 100644 Binary files a/docs/articles/introduction_files/figure-html/area-1.png and b/docs/articles/introduction_files/figure-html/area-1.png differ diff --git a/docs/articles/introduction_files/figure-html/diagnostic-1.png b/docs/articles/introduction_files/figure-html/diagnostic-1.png index ea5f99e..2345a18 100644 Binary files a/docs/articles/introduction_files/figure-html/diagnostic-1.png and b/docs/articles/introduction_files/figure-html/diagnostic-1.png differ diff --git a/docs/articles/introduction_files/figure-html/heatmap-1.png b/docs/articles/introduction_files/figure-html/heatmap-1.png index 8d108d7..5f134a5 100644 Binary files a/docs/articles/introduction_files/figure-html/heatmap-1.png and b/docs/articles/introduction_files/figure-html/heatmap-1.png differ diff --git a/docs/articles/introduction_files/figure-html/line-1.png b/docs/articles/introduction_files/figure-html/line-1.png index 1359b5d..785a05a 100644 Binary files a/docs/articles/introduction_files/figure-html/line-1.png and b/docs/articles/introduction_files/figure-html/line-1.png differ diff --git a/docs/articles/introduction_files/figure-html/line-2-1.png b/docs/articles/introduction_files/figure-html/line-2-1.png index d75376f..31ddbec 100644 Binary files a/docs/articles/introduction_files/figure-html/line-2-1.png and b/docs/articles/introduction_files/figure-html/line-2-1.png differ diff --git a/docs/bootstrap-toc.css b/docs/bootstrap-toc.css deleted file mode 100644 index 5a85941..0000000 --- a/docs/bootstrap-toc.css +++ /dev/null @@ -1,60 +0,0 @@ -/*! - * Bootstrap Table of Contents v0.4.1 (http://afeld.github.io/bootstrap-toc/) - * Copyright 2015 Aidan Feldman - * Licensed under MIT (https://github.com/afeld/bootstrap-toc/blob/gh-pages/LICENSE.md) */ - -/* modified from https://github.com/twbs/bootstrap/blob/94b4076dd2efba9af71f0b18d4ee4b163aa9e0dd/docs/assets/css/src/docs.css#L548-L601 */ - -/* All levels of nav */ -nav[data-toggle='toc'] .nav > li > a { - display: block; - padding: 4px 20px; - font-size: 13px; - font-weight: 500; - color: #767676; -} -nav[data-toggle='toc'] .nav > li > a:hover, -nav[data-toggle='toc'] .nav > li > a:focus { - padding-left: 19px; - color: #563d7c; - text-decoration: none; - background-color: transparent; - border-left: 1px solid #563d7c; -} -nav[data-toggle='toc'] .nav > .active > a, -nav[data-toggle='toc'] .nav > .active:hover > a, -nav[data-toggle='toc'] .nav > .active:focus > a { - padding-left: 18px; - font-weight: bold; - color: #563d7c; - background-color: transparent; - border-left: 2px solid #563d7c; -} - -/* Nav: second level (shown on .active) */ -nav[data-toggle='toc'] .nav .nav { - display: none; /* Hide by default, but at >768px, show it */ - padding-bottom: 10px; -} -nav[data-toggle='toc'] .nav .nav > li > a { - padding-top: 1px; - padding-bottom: 1px; - padding-left: 30px; - font-size: 12px; - font-weight: normal; -} -nav[data-toggle='toc'] .nav .nav > li > a:hover, -nav[data-toggle='toc'] .nav .nav > li > a:focus { - padding-left: 29px; -} -nav[data-toggle='toc'] .nav .nav > .active > a, -nav[data-toggle='toc'] .nav .nav > .active:hover > a, -nav[data-toggle='toc'] .nav .nav > .active:focus > a { - padding-left: 28px; - font-weight: 500; -} - -/* from https://github.com/twbs/bootstrap/blob/e38f066d8c203c3e032da0ff23cd2d6098ee2dd6/docs/assets/css/src/docs.css#L631-L634 */ -nav[data-toggle='toc'] .nav > .active > ul { - display: block; -} diff --git a/docs/bootstrap-toc.js b/docs/bootstrap-toc.js deleted file mode 100644 index 1cdd573..0000000 --- a/docs/bootstrap-toc.js +++ /dev/null @@ -1,159 +0,0 @@ -/*! - * Bootstrap Table of Contents v0.4.1 (http://afeld.github.io/bootstrap-toc/) - * Copyright 2015 Aidan Feldman - * Licensed under MIT (https://github.com/afeld/bootstrap-toc/blob/gh-pages/LICENSE.md) */ -(function() { - 'use strict'; - - window.Toc = { - helpers: { - // return all matching elements in the set, or their descendants - findOrFilter: function($el, selector) { - // http://danielnouri.org/notes/2011/03/14/a-jquery-find-that-also-finds-the-root-element/ - // http://stackoverflow.com/a/12731439/358804 - var $descendants = $el.find(selector); - return $el.filter(selector).add($descendants).filter(':not([data-toc-skip])'); - }, - - generateUniqueIdBase: function(el) { - var text = $(el).text(); - var anchor = text.trim().toLowerCase().replace(/[^A-Za-z0-9]+/g, '-'); - return anchor || el.tagName.toLowerCase(); - }, - - generateUniqueId: function(el) { - var anchorBase = this.generateUniqueIdBase(el); - for (var i = 0; ; i++) { - var anchor = anchorBase; - if (i > 0) { - // add suffix - anchor += '-' + i; - } - // check if ID already exists - if (!document.getElementById(anchor)) { - return anchor; - } - } - }, - - generateAnchor: function(el) { - if (el.id) { - return el.id; - } else { - var anchor = this.generateUniqueId(el); - el.id = anchor; - return anchor; - } - }, - - createNavList: function() { - return $(''); - }, - - createChildNavList: function($parent) { - var $childList = this.createNavList(); - $parent.append($childList); - return $childList; - }, - - generateNavEl: function(anchor, text) { - var $a = $(''); - $a.attr('href', '#' + anchor); - $a.text(text); - var $li = $('
  • '); - $li.append($a); - return $li; - }, - - generateNavItem: function(headingEl) { - var anchor = this.generateAnchor(headingEl); - var $heading = $(headingEl); - var text = $heading.data('toc-text') || $heading.text(); - return this.generateNavEl(anchor, text); - }, - - // Find the first heading level (`

    `, then `

    `, etc.) that has more than one element. Defaults to 1 (for `

    `). - getTopLevel: function($scope) { - for (var i = 1; i <= 6; i++) { - var $headings = this.findOrFilter($scope, 'h' + i); - if ($headings.length > 1) { - return i; - } - } - - return 1; - }, - - // returns the elements for the top level, and the next below it - getHeadings: function($scope, topLevel) { - var topSelector = 'h' + topLevel; - - var secondaryLevel = topLevel + 1; - var secondarySelector = 'h' + secondaryLevel; - - return this.findOrFilter($scope, topSelector + ',' + secondarySelector); - }, - - getNavLevel: function(el) { - return parseInt(el.tagName.charAt(1), 10); - }, - - populateNav: function($topContext, topLevel, $headings) { - var $context = $topContext; - var $prevNav; - - var helpers = this; - $headings.each(function(i, el) { - var $newNav = helpers.generateNavItem(el); - var navLevel = helpers.getNavLevel(el); - - // determine the proper $context - if (navLevel === topLevel) { - // use top level - $context = $topContext; - } else if ($prevNav && $context === $topContext) { - // create a new level of the tree and switch to it - $context = helpers.createChildNavList($prevNav); - } // else use the current $context - - $context.append($newNav); - - $prevNav = $newNav; - }); - }, - - parseOps: function(arg) { - var opts; - if (arg.jquery) { - opts = { - $nav: arg - }; - } else { - opts = arg; - } - opts.$scope = opts.$scope || $(document.body); - return opts; - } - }, - - // accepts a jQuery object, or an options object - init: function(opts) { - opts = this.helpers.parseOps(opts); - - // ensure that the data attribute is in place for styling - opts.$nav.attr('data-toggle', 'toc'); - - var $topContext = this.helpers.createChildNavList(opts.$nav); - var topLevel = this.helpers.getTopLevel(opts.$scope); - var $headings = this.helpers.getHeadings(opts.$scope, topLevel); - this.helpers.populateNav($topContext, topLevel, $headings); - } - }; - - $(function() { - $('nav[data-toggle="toc"]').each(function(i, el) { - var $nav = $(el); - Toc.init($nav); - }); - }); -})(); diff --git a/docs/docsearch.css b/docs/docsearch.css deleted file mode 100644 index e5f1fe1..0000000 --- a/docs/docsearch.css +++ /dev/null @@ -1,148 +0,0 @@ -/* Docsearch -------------------------------------------------------------- */ -/* - Source: https://github.com/algolia/docsearch/ - License: MIT -*/ - -.algolia-autocomplete { - display: block; - -webkit-box-flex: 1; - -ms-flex: 1; - flex: 1 -} - -.algolia-autocomplete .ds-dropdown-menu { - width: 100%; - min-width: none; - max-width: none; - padding: .75rem 0; - background-color: #fff; - background-clip: padding-box; - border: 1px solid rgba(0, 0, 0, .1); - box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .175); -} - -@media (min-width:768px) { - .algolia-autocomplete .ds-dropdown-menu { - width: 175% - } -} - -.algolia-autocomplete .ds-dropdown-menu::before { - display: none -} - -.algolia-autocomplete .ds-dropdown-menu [class^=ds-dataset-] { - padding: 0; - background-color: rgb(255,255,255); - border: 0; - max-height: 80vh; -} - -.algolia-autocomplete .ds-dropdown-menu .ds-suggestions { - margin-top: 0 -} - -.algolia-autocomplete .algolia-docsearch-suggestion { - padding: 0; - overflow: visible -} - -.algolia-autocomplete .algolia-docsearch-suggestion--category-header { - padding: .125rem 1rem; - margin-top: 0; - font-size: 1.3em; - font-weight: 500; - color: #00008B; - border-bottom: 0 -} - -.algolia-autocomplete .algolia-docsearch-suggestion--wrapper { - float: none; - padding-top: 0 -} - -.algolia-autocomplete .algolia-docsearch-suggestion--subcategory-column { - float: none; - width: auto; - padding: 0; - text-align: left -} - -.algolia-autocomplete .algolia-docsearch-suggestion--content { - float: none; - width: auto; - padding: 0 -} - -.algolia-autocomplete .algolia-docsearch-suggestion--content::before { - display: none -} - -.algolia-autocomplete .ds-suggestion:not(:first-child) .algolia-docsearch-suggestion--category-header { - padding-top: .75rem; - margin-top: .75rem; - border-top: 1px solid rgba(0, 0, 0, .1) -} - -.algolia-autocomplete .ds-suggestion .algolia-docsearch-suggestion--subcategory-column { - display: block; - padding: .1rem 1rem; - margin-bottom: 0.1; - font-size: 1.0em; - font-weight: 400 - /* display: none */ -} - -.algolia-autocomplete .algolia-docsearch-suggestion--title { - display: block; - padding: .25rem 1rem; - margin-bottom: 0; - font-size: 0.9em; - font-weight: 400 -} - -.algolia-autocomplete .algolia-docsearch-suggestion--text { - padding: 0 1rem .5rem; - margin-top: -.25rem; - font-size: 0.8em; - font-weight: 400; - line-height: 1.25 -} - -.algolia-autocomplete .algolia-docsearch-footer { - width: 110px; - height: 20px; - z-index: 3; - margin-top: 10.66667px; - float: right; - font-size: 0; - line-height: 0; -} - -.algolia-autocomplete .algolia-docsearch-footer--logo { - background-image: url("data:image/svg+xml;utf8,"); - background-repeat: no-repeat; - background-position: 50%; - background-size: 100%; - overflow: hidden; - text-indent: -9000px; - width: 100%; - height: 100%; - display: block; - transform: translate(-8px); -} - -.algolia-autocomplete .algolia-docsearch-suggestion--highlight { - color: #FF8C00; - background: rgba(232, 189, 54, 0.1) -} - - -.algolia-autocomplete .algolia-docsearch-suggestion--text .algolia-docsearch-suggestion--highlight { - box-shadow: inset 0 -2px 0 0 rgba(105, 105, 105, .5) -} - -.algolia-autocomplete .ds-suggestion.ds-cursor .algolia-docsearch-suggestion--content { - background-color: rgba(192, 192, 192, .15) -} diff --git a/docs/docsearch.js b/docs/docsearch.js deleted file mode 100644 index b35504c..0000000 --- a/docs/docsearch.js +++ /dev/null @@ -1,85 +0,0 @@ -$(function() { - - // register a handler to move the focus to the search bar - // upon pressing shift + "/" (i.e. "?") - $(document).on('keydown', function(e) { - if (e.shiftKey && e.keyCode == 191) { - e.preventDefault(); - $("#search-input").focus(); - } - }); - - $(document).ready(function() { - // do keyword highlighting - /* modified from https://jsfiddle.net/julmot/bL6bb5oo/ */ - var mark = function() { - - var referrer = document.URL ; - var paramKey = "q" ; - - if (referrer.indexOf("?") !== -1) { - var qs = referrer.substr(referrer.indexOf('?') + 1); - var qs_noanchor = qs.split('#')[0]; - var qsa = qs_noanchor.split('&'); - var keyword = ""; - - for (var i = 0; i < qsa.length; i++) { - var currentParam = qsa[i].split('='); - - if (currentParam.length !== 2) { - continue; - } - - if (currentParam[0] == paramKey) { - keyword = decodeURIComponent(currentParam[1].replace(/\+/g, "%20")); - } - } - - if (keyword !== "") { - $(".contents").unmark({ - done: function() { - $(".contents").mark(keyword); - } - }); - } - } - }; - - mark(); - }); -}); - -/* Search term highlighting ------------------------------*/ - -function matchedWords(hit) { - var words = []; - - var hierarchy = hit._highlightResult.hierarchy; - // loop to fetch from lvl0, lvl1, etc. - for (var idx in hierarchy) { - words = words.concat(hierarchy[idx].matchedWords); - } - - var content = hit._highlightResult.content; - if (content) { - words = words.concat(content.matchedWords); - } - - // return unique words - var words_uniq = [...new Set(words)]; - return words_uniq; -} - -function updateHitURL(hit) { - - var words = matchedWords(hit); - var url = ""; - - if (hit.anchor) { - url = hit.url_without_anchor + '?q=' + escape(words.join(" ")) + '#' + hit.anchor; - } else { - url = hit.url + '?q=' + escape(words.join(" ")); - } - - return url; -} diff --git a/docs/index.html b/docs/index.html index c66e5f6..e173d68 100644 --- a/docs/index.html +++ b/docs/index.html @@ -76,12 +76,12 @@
    - +

    Bayesian reasoning in medical contexts

    @@ -100,8 +100,8 @@

    Bayesian reasoning in medical co min_possible_prevalence(): Calculates how high should the prevalence of a disease be to reach a desired PPV given certain test parameters.
    -

    You can install the stable (CRAN) version of the package with install.packages("BayesianReasoning") or development version with remotes::install_github("gorkang/BayesianReasoning@dev"). Please report any problems you find in the Issues Github page.

    -

    There is a shiny app implementation with most of the main features of the PPV_heatmap() function available.

    +

    If you want to install the package can use: remotes::install_github("gorkang/BayesianReasoning"). Please report any problems you find in the Issues Github page.

    +

    There is a shiny app implementation with most of the main features available.


    @@ -119,27 +119,21 @@

    PPV_heatmap()
    -
    -PPV_heatmap(min_Prevalence = 1,
    -            max_Prevalence = 1000, 
    -            Sensitivity = 100, 
    -            Language = "en")
    -            

    -

    +
    PPV_heatmap(min_Prevalence = 1,
    +            max_Prevalence = 1000, 
    +            Sensitivity = 100, limits_Specificity = c(90, 100),
    +            Language = "en")
    +


    NPV

    You can also plot an NPV heatmap with PPV_NPV = “NPV”.

    -
    -
    -PPV_heatmap(PPV_NPV = "NPV",
    -            min_Prevalence = 800,
    -            max_Prevalence = 1000, 
    -            Specificity = 95, 
    -            Language = "en")
    -

    +
    PPV_heatmap(PPV_NPV = "NPV",
    +            min_Prevalence = 800, max_Prevalence = 1000, 
    +            Specificity = 95, limits_Sensitivity = c(90, 100),
    +            Language = "en")
    +


    @@ -147,50 +141,54 @@

    Area overlay
    -
    -PPV_heatmap(min_Prevalence = 1, max_Prevalence = 1200, 
    -            Sensitivity = 81, 
    -            limits_Specificity = c(94, 100),
    -            label_subtitle = "Prenatal screening for Down Syndrome by Age",
    -            overlay = "area",
    -            overlay_labels = "40 y.o.",
    -            overlay_position_FP = 4.8,
    -            overlay_prevalence_1 = 1,
    -            overlay_prevalence_2 = 68)

    -

    +
    PPV_heatmap(min_Prevalence = 1, max_Prevalence = 1200, 
    +            Sensitivity = 81, 
    +            limits_Specificity = c(94, 100),
    +            label_subtitle = "Prenatal screening for Down Syndrome by Age",
    +            overlay = "area",
    +            overlay_labels = "40 y.o.",
    +            overlay_position_FP = 4.8,
    +            overlay_prevalence_1 = 1,
    +            overlay_prevalence_2 = 68)
    +

    +

    The area plot overlay can show more details about how the calculation of PPV/NPV is performed:

    +
    PPV_heatmap(min_Prevalence = 1, max_Prevalence = 1200, 
    +            Sensitivity = 81, 
    +            limits_Specificity = c(94, 100),
    +            label_subtitle = "Prenatal screening for Down Syndrome by Age", 
    +            overlay_extra_info = TRUE,
    +            overlay = "area",
    +            overlay_labels = "40 y.o.",
    +            overlay_position_FP = 4.8,
    +            overlay_prevalence_1 = 1,
    +            overlay_prevalence_2 = 68)
    +

    Line overlay

    Also, you can add a line overlay highlighting a range of prevalences and FP. This is useful, for example, to show how the PPV of a test changes with age:

    -
    -
    -PPV_heatmap(min_Prevalence = 1, max_Prevalence = 1800, 
    -            Sensitivity = 90, 
    -            limits_Specificity = c(84, 100),
    -            label_subtitle = "PPV of Mammogram for Breast Cancer by Age",
    -            overlay = "line", 
    -            overlay_labels = c("80 y.o.", "70 y.o.", "60 y.o.", "50 y.o.", "40 y.o.", "30 y.o.", "20  y.o."),
    -            overlay_position_FP = c(6.5, 7, 8, 9, 12, 14, 14),
    -            overlay_prevalence_1 = c(1, 1, 1, 1, 1, 1, 1),
    -            overlay_prevalence_2 = c(22, 26, 29, 44, 69, 227, 1667))
    -            
    -

    +
    PPV_heatmap(min_Prevalence = 1, max_Prevalence = 1800, 
    +            Sensitivity = 90, 
    +            limits_Specificity = c(84, 100),
    +            label_subtitle = "PPV of Mammogram for Breast Cancer by Age",
    +            overlay = "line", 
    +            overlay_labels = c("80 y.o.", "70 y.o.", "60 y.o.", "50 y.o.", "40 y.o.", "30 y.o.", "20  y.o."),
    +            overlay_position_FP = c(6.5, 7, 8, 9, 12, 14, 14),
    +            overlay_prevalence_1 = c(1, 1, 1, 1, 1, 1, 1),
    +            overlay_prevalence_2 = c(22, 26, 29, 44, 69, 227, 1667))
    +


    Another example. In this case, the FP is constant across age:

    -
    -
    -PPV_heatmap(min_Prevalence = 1, max_Prevalence = 2000, Sensitivity = 81, 
    -            limits_Specificity = c(94, 100),
    -            label_subtitle = "Prenatal screening for Down Syndrome by Age",
    -            overlay = "line",
    -            overlay_labels = c("40 y.o.", "30 y.o.", "20 y.o."),
    -            overlay_position_FP = c(4.8, 4.8, 4.8),
    -            overlay_prevalence_1 = c(1, 1, 1),
    -            overlay_prevalence_2 = c(68, 626, 1068))
    -            
    -

    +
    PPV_heatmap(min_Prevalence = 1, max_Prevalence = 2000, Sensitivity = 81, 
    +            limits_Specificity = c(94, 100),
    +            label_subtitle = "Prenatal screening for Down Syndrome by Age",
    +            overlay = "line",
    +            overlay_labels = c("40 y.o.", "30 y.o.", "20 y.o."),
    +            overlay_position_FP = c(4.8, 4.8, 4.8),
    +            overlay_prevalence_1 = c(1, 1, 1),
    +            overlay_prevalence_2 = c(68, 626, 1068))
    +


    @@ -199,14 +197,11 @@

    PPV_diagnostic_vs_screening()
    -
    -PPV_diagnostic_vs_screening(max_FP = 10, 
    -                            Sensitivity = 100, 
    -                            prevalence_screening_group = 1000, 
    -                            prevalence_diagnostic_group = 2)
    -                            

    -

    +
    PPV_diagnostic_vs_screening(max_FP = 10, 
    +                            Sensitivity = 100, 
    +                            prevalence_screening_group = 1000, 
    +                            prevalence_diagnostic_group = 2)
    +


    @@ -214,19 +209,17 @@

    min_possible_prevalence()

    Imagine you would like to use a test in a population and want to have a 98% PPV. That is, IF a positive result comes out in the test, you would like a 98% certainty that it is a true positive.

    How high should the prevalence of the disease be in that group?

    -
    -min_possible_prevalence(Sensitivity = 100, 
    -                        FP_test = 0.1, 
    -                        min_PPV_desired = 98)
    +
    min_possible_prevalence(Sensitivity = 100, 
    +                        FP_test = 0.1, 
    +                        min_PPV_desired = 98)

    To reach a PPV of 98 when using a test with 100 % Sensitivity and 0.1 % False Positive Rate, you need a prevalence of at least 1 out of 21


    Another example, with a very good test, and lower expectations:

    -
    -min_possible_prevalence(Sensitivity = 99.9, 
    -                        FP_test = .1, 
    -                        min_PPV_desired = 70)
    +
    min_possible_prevalence(Sensitivity = 99.9, 
    +                        FP_test = .1, 
    +                        min_PPV_desired = 70)

    To reach a PPV of 70 when using a test with 99.9 % Sensitivity and 0.1 % False Positive Rate, you need a prevalence of at least 1 out of 429

    diff --git a/docs/logo.png b/docs/logo.png index 4494607..a0a19cf 100644 Binary files a/docs/logo.png and b/docs/logo.png differ diff --git a/docs/pkgdown.css b/docs/pkgdown.css deleted file mode 100644 index 80ea5b8..0000000 --- a/docs/pkgdown.css +++ /dev/null @@ -1,384 +0,0 @@ -/* Sticky footer */ - -/** - * Basic idea: https://philipwalton.github.io/solved-by-flexbox/demos/sticky-footer/ - * Details: https://github.com/philipwalton/solved-by-flexbox/blob/master/assets/css/components/site.css - * - * .Site -> body > .container - * .Site-content -> body > .container .row - * .footer -> footer - * - * Key idea seems to be to ensure that .container and __all its parents__ - * have height set to 100% - * - */ - -html, body { - height: 100%; -} - -body { - position: relative; -} - -body > .container { - display: flex; - height: 100%; - flex-direction: column; -} - -body > .container .row { - flex: 1 0 auto; -} - -footer { - margin-top: 45px; - padding: 35px 0 36px; - border-top: 1px solid #e5e5e5; - color: #666; - display: flex; - flex-shrink: 0; -} -footer p { - margin-bottom: 0; -} -footer div { - flex: 1; -} -footer .pkgdown { - text-align: right; -} -footer p { - margin-bottom: 0; -} - -img.icon { - float: right; -} - -/* Ensure in-page images don't run outside their container */ -.contents img { - max-width: 100%; - height: auto; -} - -/* Fix bug in bootstrap (only seen in firefox) */ -summary { - display: list-item; -} - -/* Typographic tweaking ---------------------------------*/ - -.contents .page-header { - margin-top: calc(-60px + 1em); -} - -dd { - margin-left: 3em; -} - -/* Section anchors ---------------------------------*/ - -a.anchor { - display: none; - margin-left: 5px; - width: 20px; - height: 20px; - - background-image: url(./link.svg); - background-repeat: no-repeat; - background-size: 20px 20px; - background-position: center center; -} - -h1:hover .anchor, -h2:hover .anchor, -h3:hover .anchor, -h4:hover .anchor, -h5:hover .anchor, -h6:hover .anchor { - display: inline-block; -} - -/* Fixes for fixed navbar --------------------------*/ - -.contents h1, .contents h2, .contents h3, .contents h4 { - padding-top: 60px; - margin-top: -40px; -} - -/* Navbar submenu --------------------------*/ - -.dropdown-submenu { - position: relative; -} - -.dropdown-submenu>.dropdown-menu { - top: 0; - left: 100%; - margin-top: -6px; - margin-left: -1px; - border-radius: 0 6px 6px 6px; -} - -.dropdown-submenu:hover>.dropdown-menu { - display: block; -} - -.dropdown-submenu>a:after { - display: block; - content: " "; - float: right; - width: 0; - height: 0; - border-color: transparent; - border-style: solid; - border-width: 5px 0 5px 5px; - border-left-color: #cccccc; - margin-top: 5px; - margin-right: -10px; -} - -.dropdown-submenu:hover>a:after { - border-left-color: #ffffff; -} - -.dropdown-submenu.pull-left { - float: none; -} - -.dropdown-submenu.pull-left>.dropdown-menu { - left: -100%; - margin-left: 10px; - border-radius: 6px 0 6px 6px; -} - -/* Sidebar --------------------------*/ - -#pkgdown-sidebar { - margin-top: 30px; - position: -webkit-sticky; - position: sticky; - top: 70px; -} - -#pkgdown-sidebar h2 { - font-size: 1.5em; - margin-top: 1em; -} - -#pkgdown-sidebar h2:first-child { - margin-top: 0; -} - -#pkgdown-sidebar .list-unstyled li { - margin-bottom: 0.5em; -} - -/* bootstrap-toc tweaks ------------------------------------------------------*/ - -/* All levels of nav */ - -nav[data-toggle='toc'] .nav > li > a { - padding: 4px 20px 4px 6px; - font-size: 1.5rem; - font-weight: 400; - color: inherit; -} - -nav[data-toggle='toc'] .nav > li > a:hover, -nav[data-toggle='toc'] .nav > li > a:focus { - padding-left: 5px; - color: inherit; - border-left: 1px solid #878787; -} - -nav[data-toggle='toc'] .nav > .active > a, -nav[data-toggle='toc'] .nav > .active:hover > a, -nav[data-toggle='toc'] .nav > .active:focus > a { - padding-left: 5px; - font-size: 1.5rem; - font-weight: 400; - color: inherit; - border-left: 2px solid #878787; -} - -/* Nav: second level (shown on .active) */ - -nav[data-toggle='toc'] .nav .nav { - display: none; /* Hide by default, but at >768px, show it */ - padding-bottom: 10px; -} - -nav[data-toggle='toc'] .nav .nav > li > a { - padding-left: 16px; - font-size: 1.35rem; -} - -nav[data-toggle='toc'] .nav .nav > li > a:hover, -nav[data-toggle='toc'] .nav .nav > li > a:focus { - padding-left: 15px; -} - -nav[data-toggle='toc'] .nav .nav > .active > a, -nav[data-toggle='toc'] .nav .nav > .active:hover > a, -nav[data-toggle='toc'] .nav .nav > .active:focus > a { - padding-left: 15px; - font-weight: 500; - font-size: 1.35rem; -} - -/* orcid ------------------------------------------------------------------- */ - -.orcid { - font-size: 16px; - color: #A6CE39; - /* margins are required by official ORCID trademark and display guidelines */ - margin-left:4px; - margin-right:4px; - vertical-align: middle; -} - -/* Reference index & topics ----------------------------------------------- */ - -.ref-index th {font-weight: normal;} - -.ref-index td {vertical-align: top; min-width: 100px} -.ref-index .icon {width: 40px;} -.ref-index .alias {width: 40%;} -.ref-index-icons .alias {width: calc(40% - 40px);} -.ref-index .title {width: 60%;} - -.ref-arguments th {text-align: right; padding-right: 10px;} -.ref-arguments th, .ref-arguments td {vertical-align: top; min-width: 100px} -.ref-arguments .name {width: 20%;} -.ref-arguments .desc {width: 80%;} - -/* Nice scrolling for wide elements --------------------------------------- */ - -table { - display: block; - overflow: auto; -} - -/* Syntax highlighting ---------------------------------------------------- */ - -pre, code, pre code { - background-color: #f8f8f8; - color: #333; -} -pre, pre code { - white-space: pre-wrap; - word-break: break-all; - overflow-wrap: break-word; -} - -pre { - border: 1px solid #eee; -} - -pre .img, pre .r-plt { - margin: 5px 0; -} - -pre .img img, pre .r-plt img { - background-color: #fff; -} - -code a, pre a { - color: #375f84; -} - -a.sourceLine:hover { - text-decoration: none; -} - -.fl {color: #1514b5;} -.fu {color: #000000;} /* function */ -.ch,.st {color: #036a07;} /* string */ -.kw {color: #264D66;} /* keyword */ -.co {color: #888888;} /* comment */ - -.error {font-weight: bolder;} -.warning {font-weight: bolder;} - -/* Clipboard --------------------------*/ - -.hasCopyButton { - position: relative; -} - -.btn-copy-ex { - position: absolute; - right: 0; - top: 0; - visibility: hidden; -} - -.hasCopyButton:hover button.btn-copy-ex { - visibility: visible; -} - -/* headroom.js ------------------------ */ - -.headroom { - will-change: transform; - transition: transform 200ms linear; -} -.headroom--pinned { - transform: translateY(0%); -} -.headroom--unpinned { - transform: translateY(-100%); -} - -/* mark.js ----------------------------*/ - -mark { - background-color: rgba(255, 255, 51, 0.5); - border-bottom: 2px solid rgba(255, 153, 51, 0.3); - padding: 1px; -} - -/* vertical spacing after htmlwidgets */ -.html-widget { - margin-bottom: 10px; -} - -/* fontawesome ------------------------ */ - -.fab { - font-family: "Font Awesome 5 Brands" !important; -} - -/* don't display links in code chunks when printing */ -/* source: https://stackoverflow.com/a/10781533 */ -@media print { - code a:link:after, code a:visited:after { - content: ""; - } -} - -/* Section anchors --------------------------------- - Added in pandoc 2.11: https://github.com/jgm/pandoc-templates/commit/9904bf71 -*/ - -div.csl-bib-body { } -div.csl-entry { - clear: both; -} -.hanging-indent div.csl-entry { - margin-left:2em; - text-indent:-2em; -} -div.csl-left-margin { - min-width:2em; - float:left; -} -div.csl-right-inline { - margin-left:2em; - padding-left:1em; -} -div.csl-indent { - margin-left: 2em; -} diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index d2ca312..0f572ba 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -4,5 +4,5 @@ pkgdown_sha: ~ articles: PPV_NPV: PPV_NPV.html introduction: introduction.html -last_built: 2021-12-20T14:17Z +last_built: 2021-12-21T16:08Z diff --git a/docs/reference/PPV_heatmap.html b/docs/reference/PPV_heatmap.html index 147a74e..bda6557 100644 --- a/docs/reference/PPV_heatmap.html +++ b/docs/reference/PPV_heatmap.html @@ -80,7 +80,8 @@

    Usage folder = "", PPV_NPV = "PPV", steps_matrix = 100, - DEBUG = FALSE + DEBUG = FALSE, + ... )

    @@ -130,6 +131,8 @@

    Arguments

    Value

    diff --git a/docs/reference/dot-get_point_ppv_npv.html b/docs/reference/dot-get_point_ppv_npv.html index e062e5f..02bcc94 100644 --- a/docs/reference/dot-get_point_ppv_npv.html +++ b/docs/reference/dot-get_point_ppv_npv.html @@ -94,7 +94,7 @@

    ArgumentsArguments