aboutsummaryrefslogtreecommitdiff
path: root/inst/app/templates/content/estimation
diff options
context:
space:
mode:
authorNaeem Model <me@nmode.ca>2025-01-06 23:55:43 +0000
committerNaeem Model <me@nmode.ca>2025-01-06 23:55:43 +0000
commite920b3e514e717fc05ed524267d3b53e272fec51 (patch)
tree353cfb36aca946d69da6d6dcacc0cb66177050ef /inst/app/templates/content/estimation
parent2d34b71c7a8da7fd0fac59b934145286b2be7b1f (diff)
Update web app entry point
- Rename 'app' -> 'web' - Return shiny app object in entry point function
Diffstat (limited to 'inst/app/templates/content/estimation')
-rw-r--r--inst/app/templates/content/estimation/about-estimators.html31
-rw-r--r--inst/app/templates/content/estimation/about-estimators/id.html3
-rw-r--r--inst/app/templates/content/estimation/about-estimators/idea.html4
-rw-r--r--inst/app/templates/content/estimation/about-estimators/panel.html14
-rw-r--r--inst/app/templates/content/estimation/about-estimators/seq_bayes.html9
-rw-r--r--inst/app/templates/content/estimation/about-estimators/wp.html6
-rw-r--r--inst/app/templates/content/estimation/estimates.html3
-rw-r--r--inst/app/templates/content/estimation/estimates/add-estimators.html16
-rw-r--r--inst/app/templates/content/estimation/estimates/add-estimators/id.html1
-rw-r--r--inst/app/templates/content/estimation/estimates/add-estimators/idea.html1
-rw-r--r--inst/app/templates/content/estimation/estimates/add-estimators/mu.html22
-rw-r--r--inst/app/templates/content/estimation/estimates/add-estimators/parameters.html7
-rw-r--r--inst/app/templates/content/estimation/estimates/add-estimators/seq_bayes.html22
-rw-r--r--inst/app/templates/content/estimation/estimates/add-estimators/wp.html39
-rw-r--r--inst/app/templates/content/estimation/estimates/estimates-table.html19
15 files changed, 0 insertions, 197 deletions
diff --git a/inst/app/templates/content/estimation/about-estimators.html b/inst/app/templates/content/estimation/about-estimators.html
deleted file mode 100644
index db2898b..0000000
--- a/inst/app/templates/content/estimation/about-estimators.html
+++ /dev/null
@@ -1,31 +0,0 @@
-<div class="accordion accordion-flush" id="estimation-accordion">
- {{
- htmlTemplate("templates/content/estimation/about-estimators/panel.html",
- id = "id",
- header = "Incidence Decay (ID)",
- reference_label = "Fisman et al. (PloS One, 2013)",
- reference_url = "https://doi.org/10.1371/journal.pone.0083622"
- )
- }}
- {{
- htmlTemplate("templates/content/estimation/about-estimators/panel.html",
- id = "idea", header = "Incidence Decay and Exponential Adjustment (IDEA)",
- reference_label = "Fisman et al. (PloS One, 2013)",
- reference_url = "https://doi.org/10.1371/journal.pone.0083622"
- )
- }}
- {{
- htmlTemplate("templates/content/estimation/about-estimators/panel.html",
- id = "seq_bayes", header = "Sequential Bayes (seqB)",
- reference_label = "Bettencourt and Riberio (PloS One, 2008)",
- reference_url = "https://doi.org/10.1371/journal.pone.0002185"
- )
- }}
- {{
- htmlTemplate("templates/content/estimation/about-estimators/panel.html",
- id = "wp", header = "White and Pagano (WP)",
- reference_label = "White and Pagano (Statistics in Medicine, 2008)",
- reference_url = "https://doi.org/10.1002/sim.3136"
- )
- }}
-</div>
diff --git a/inst/app/templates/content/estimation/about-estimators/id.html b/inst/app/templates/content/estimation/about-estimators/id.html
deleted file mode 100644
index fc70b1c..0000000
--- a/inst/app/templates/content/estimation/about-estimators/id.html
+++ /dev/null
@@ -1,3 +0,0 @@
-The Incidence Decay (ID) estimator uses the method of least squares to estimate <em>R</em><sub>0</sub>.
-This method assumes the serial interval is known, and is built under the SIR assumption.
-We note that the use of this method might result in the underestimation of <em>R</em><sub>0</sub>.
diff --git a/inst/app/templates/content/estimation/about-estimators/idea.html b/inst/app/templates/content/estimation/about-estimators/idea.html
deleted file mode 100644
index 67548f8..0000000
--- a/inst/app/templates/content/estimation/about-estimators/idea.html
+++ /dev/null
@@ -1,4 +0,0 @@
-The Incidence Decay and Exponential Adjustment (ID) estimator is an alternative formulation of the Incidence Decay (ID) model which includes a decay factor to reflect the often observed outbreak decline.
-This addresses the potential underestimation of the <em>R</em><sub>0</sub> estimate when using the ID method.
-The method of least squares is used to estimate <em>R</em><sub>0</sub>, and similar to the ID model, the serial interval is assumed to be known and this method is developed assuming the SIR model.
-We note that, since we need to obtain a minimizer of the decay factor to solve the optimization problem, we require that the number of cases in the dataset be at least 2.
diff --git a/inst/app/templates/content/estimation/about-estimators/panel.html b/inst/app/templates/content/estimation/about-estimators/panel.html
deleted file mode 100644
index 98fe155..0000000
--- a/inst/app/templates/content/estimation/about-estimators/panel.html
+++ /dev/null
@@ -1,14 +0,0 @@
-<div class="accordion-item">
- <h2 class="accordion-header">
- <button class="accordion-button collapsed" type="button"
- data-bs-toggle="collapse" data-bs-target="#{{ id }}">
- <h4>{{ header }}</h4>
- </button>
- </h2>
- <div id="{{ id }}" class="accordion-collapse collapse" data-bs-parent="#estimators-accordion">
- <div class="accordion-body">
- <p>Reference: <a href="{{ reference_url }}" target="_blank"><em>{{ reference_label }}</em></a></p>
- <p>{{ htmlTemplate(paste0("templates/content/estimation/about-estimators/", id, ".html")) }}</p>
- </div>
- </div>
-</div>
diff --git a/inst/app/templates/content/estimation/about-estimators/seq_bayes.html b/inst/app/templates/content/estimation/about-estimators/seq_bayes.html
deleted file mode 100644
index 8f66ab4..0000000
--- a/inst/app/templates/content/estimation/about-estimators/seq_bayes.html
+++ /dev/null
@@ -1,9 +0,0 @@
-The sequential Bayes (seqB) estimator uses a Bayesian approach to estimate <em>R</em><sub>0</sub> which updates the reproductive number estimate as data accumulates over time.
-This approach is based on the SIR model, and assumes that the mean of the serial distribution (ie. the serial interval (SI)) is known.
-It is assumed that infectious counts are observed at periodic times (ie. daily, weekly).
-This method cannot handle datasets where there are no new infections observed in a time interval, thus, to remedy this,
-some manipulation may be necessary to make the times at which infectious counts are observed sufficiently course (ie. weeks instead of days).
-Further, this method is also inappropriate in situations where long intervals between cases are observed in the initial stages of the epidemic.
-Finally, the <em>R</em><sub>0</sub> approximation behaves similarly to a branching process, which means that throughout, the population size “available” to be infected remains constant.
-We note that this assumption does not hold for the SIR/SEIR/SEAIR compartmental models.
-As such, seqB estimates should only really be considered early on in an epidemic, ie. before the inflection point of an epidemic, if the dataset being used follows these models.
diff --git a/inst/app/templates/content/estimation/about-estimators/wp.html b/inst/app/templates/content/estimation/about-estimators/wp.html
deleted file mode 100644
index c6f4580..0000000
--- a/inst/app/templates/content/estimation/about-estimators/wp.html
+++ /dev/null
@@ -1,6 +0,0 @@
-The White and Pagano (WP) estimator uses maximum likelihood estimation to estimate <em>R</em><sub>0</sub>.
-In this method, the serial interval (SI) is either known, or can be estimated along with <em>R</em><sub>0</sub>.
-It is assumed that the number of infectious individuals are observable at discrete time points (ie. daily or weekly).
-Further, this method also assumes an underlying branching process, which means that throughout, the population size “available” to be infected remains constant.
-We note that this assumption does not hold for the SIR/SEIR/SEAIR compartmental models.
-As such, WP estimates should only really be considered early on in an epidemic, ie. before the inflection point of an epidemic, if the dataset being used follows these models.
diff --git a/inst/app/templates/content/estimation/estimates.html b/inst/app/templates/content/estimation/estimates.html
deleted file mode 100644
index bc9124e..0000000
--- a/inst/app/templates/content/estimation/estimates.html
+++ /dev/null
@@ -1,3 +0,0 @@
-{{ htmlTemplate("templates/content/estimation/estimates/estimates-table.html") }}
-<hr>
-{{ htmlTemplate("templates/content/estimation/estimates/add-estimators.html") }}
diff --git a/inst/app/templates/content/estimation/estimates/add-estimators.html b/inst/app/templates/content/estimation/estimates/add-estimators.html
deleted file mode 100644
index 60111c7..0000000
--- a/inst/app/templates/content/estimation/estimates/add-estimators.html
+++ /dev/null
@@ -1,16 +0,0 @@
-<h4>Add estimators</h4>
-<form class="my-3">
- <!-- Dropdown to select estimator. -->
- <label class="form-label" for="estimator_select">Select estimator:</label>
- <select name="estimator_select" class="form-select">
- <option value="id" selected>Incidence Decay (ID)</option>
- <option value="idea">Incidence Decay and Exponential Adjustment (IDEA)</option>
- <option value="seq_bayes">Sequential Bayes (seqB)</option>
- <option value="wp">White and Pagano (WP)</option>
- </select>
- <!-- Parameters. -->
- {{ htmlTemplate("templates/content/estimation/estimates/add-estimators/parameters.html", id = "id") }}
- {{ htmlTemplate("templates/content/estimation/estimates/add-estimators/parameters.html", id = "idea") }}
- {{ htmlTemplate("templates/content/estimation/estimates/add-estimators/parameters.html", id = "seq_bayes") }}
- {{ htmlTemplate("templates/content/estimation/estimates/add-estimators/parameters.html", id = "wp") }}
-</form>
diff --git a/inst/app/templates/content/estimation/estimates/add-estimators/id.html b/inst/app/templates/content/estimation/estimates/add-estimators/id.html
deleted file mode 100644
index 7c35e55..0000000
--- a/inst/app/templates/content/estimation/estimates/add-estimators/id.html
+++ /dev/null
@@ -1 +0,0 @@
-{{ htmlTemplate("templates/content/estimation/estimates/add-estimators/mu.html", id = "id") }}
diff --git a/inst/app/templates/content/estimation/estimates/add-estimators/idea.html b/inst/app/templates/content/estimation/estimates/add-estimators/idea.html
deleted file mode 100644
index 781349f..0000000
--- a/inst/app/templates/content/estimation/estimates/add-estimators/idea.html
+++ /dev/null
@@ -1 +0,0 @@
-{{ htmlTemplate("templates/content/estimation/estimates/add-estimators/mu.html", id = "idea") }}
diff --git a/inst/app/templates/content/estimation/estimates/add-estimators/mu.html b/inst/app/templates/content/estimation/estimates/add-estimators/mu.html
deleted file mode 100644
index 8781574..0000000
--- a/inst/app/templates/content/estimation/estimates/add-estimators/mu.html
+++ /dev/null
@@ -1,22 +0,0 @@
-<!-- Serial interval label and help tooltip. -->
-<label class="form-label" for="mu_{{ id }}">
- Serial interval
- <sup data-bs-toggle="tooltip" data-bs-placement="right"
- data-bs-title="The serial interval is the time between when an infected individual (the infector) becomes
- symptomatic, to when another individual (who is infected by the infector) becomes symptomatic.">
- [?]
- </sup>
-</label>
-<div class="input-group">
- <!-- Serial interval input field. -->
- <input name="mu_{{ id }}" class="form-control" type="text">
- <!-- Days/weeks dropdown. -->
- <select name="mu_{{ id }}_units" class="form-select">
- <option value="Days" selected>Days</option>
- <option value="Weeks">Weeks</option>
- </select>
-</div>
-<!-- Warning text for incorrect values. -->
-<div>
- <small id="mu_{{ id }}_warn" class="form-text text-primary shiny-text-output"></small>
-</div>
diff --git a/inst/app/templates/content/estimation/estimates/add-estimators/parameters.html b/inst/app/templates/content/estimation/estimates/add-estimators/parameters.html
deleted file mode 100644
index 5250e31..0000000
--- a/inst/app/templates/content/estimation/estimates/add-estimators/parameters.html
+++ /dev/null
@@ -1,7 +0,0 @@
-<div class="my-4" data-display-if="input.estimator_select === '{{ id }}'">
- <h5>Parameters</h5>
- {{ htmlTemplate(paste0("templates/content/estimation/estimates/add-estimators/", id, ".html")) }}
- <button id="add_{{ id }}" type="button" class="btn btn-outline-primary btn-sm action-button mt-3">
- <span class="glyphicon glyphicon-plus"></span> Add
- </button>
-</div>
diff --git a/inst/app/templates/content/estimation/estimates/add-estimators/seq_bayes.html b/inst/app/templates/content/estimation/estimates/add-estimators/seq_bayes.html
deleted file mode 100644
index 028fabc..0000000
--- a/inst/app/templates/content/estimation/estimates/add-estimators/seq_bayes.html
+++ /dev/null
@@ -1,22 +0,0 @@
-<div class="row">
- <!-- Serial interval (mu). -->
- <div class="col-md">
- {{ htmlTemplate("templates/content/estimation/estimates/add-estimators/mu.html", id = "seq_bayes") }}
- </div>
- <!-- Maximum value of the uniform prior (kappa). -->
- <div class="col-md mt-2 mt-md-0">
- <!-- Label and help tooltip. -->
- <label class="form-label" for="kappa">
- Maximum prior (&#954;)
- <sup data-bs-toggle="tooltip" data-bs-placement="right" data-bs-html="true"
- data-bs-title="The initial maximum belief of <em>R</em><sub>0</sub>. The higher this value, the higher
- <em>R</em><sub>0</sub> is believed to be prior to the estimation.">
- [?]
- </sup>
- </label>
- <!-- Input field. -->
- <input name="kappa" class="form-control" type="text" placeholder="Default: 20">
- <!-- Warning text for incorrect values. -->
- <small id="kappa_warn" class="form-text text-primary shiny-text-output"></small>
- </div>
-</div>
diff --git a/inst/app/templates/content/estimation/estimates/add-estimators/wp.html b/inst/app/templates/content/estimation/estimates/add-estimators/wp.html
deleted file mode 100644
index 511170f..0000000
--- a/inst/app/templates/content/estimation/estimates/add-estimators/wp.html
+++ /dev/null
@@ -1,39 +0,0 @@
-<!-- Radio buttons to specify whether the serial interval is known. -->
-<label class="form-label" for="wp_mu_known">Is the serial interval known?</label>
-<div class="shiny-input-radiogroup" id="wp_mu_known">
- <div class="form-check form-check-inline">
- <label class="form-check-label">
- <input type="radio" class="form-check-input me-2" name="wp_mu_known" value="Yes" checked>Yes
- </label>
- </div>
- <div class="form-check form-check-inline">
- <label class="form-check-label">
- <input type="radio" class="form-check-input me-2" name="wp_mu_known" value="No">No
- </label>
- </div>
-</div>
-<!-- Show the input field for the serial interval if it is known. -->
-<div data-display-if="input.wp_mu_known == 'Yes'" class="mt-2 mt-md-0">
- {{ htmlTemplate("templates/content/estimation/estimates/add-estimators/mu.html", id = "wp") }}
-</div>
-<!-- Show the input fields for the grid search parameters if the serial interval is unknown. -->
-<div data-display-if="input.wp_mu_known == 'No'" class="row">
- <!-- Grid length. -->
- <div class="col-md mt-2 mt-md-0">
- <label class="form-label" for="grid_length">Grid length</label>
- <input name="grid_length" class="form-control" type="text" placeholder="Default: 100">
- <small id="grid_length_warn" class="form-text text-primary shiny-text-output"></small>
- </div>
- <!-- Maximum shape. -->
- <div class="col-md mt-2 mt-md-0">
- <label class="form-label" for="max_shape">Maximum shape</label>
- <input name="max_shape" class="form-control" type="text" placeholder="Default: 10">
- <small id="max_shape_warn" class="form-text text-primary shiny-text-output"></small>
- </div>
- <!-- Grid length. -->
- <div class="col-md mt-2 mt-md-0">
- <label class="form-label" for="max_scale">Maximum scale</label>
- <input name="max_scale" class="form-control" type="text" placeholder="Default: 10">
- <small id="max_scale_warn" class="form-text text-primary shiny-text-output"></small>
- </div>
-</div>
diff --git a/inst/app/templates/content/estimation/estimates/estimates-table.html b/inst/app/templates/content/estimation/estimates/estimates-table.html
deleted file mode 100644
index 4704d03..0000000
--- a/inst/app/templates/content/estimation/estimates/estimates-table.html
+++ /dev/null
@@ -1,19 +0,0 @@
-<h4>Estimates table</h4>
-<!-- Estimates table. -->
-<div class="my-3">
- {{ DT::dataTableOutput(outputId = "estimates_table") }}
-</div>
-<!-- Display inactive delete button when no rows are selected. -->
-<button type="button" class="btn btn-primary btn-sm text-white" disabled
- data-display-if="'estimates_table_rows_selected' in input && input.estimates_table_rows_selected.length == 0">
- <span class="glyphicon glyphicon-remove"></span> Delete row(s)
-</button>
-<!-- Display active delete button when at least one row is selected. -->
-<button id="estimators_delete" type="button" class="btn btn-primary btn-sm action-button text-white"
- data-display-if="'estimates_table_rows_selected' in input && input.estimates_table_rows_selected.length != 0">
- <span class="glyphicon glyphicon-remove"></span> Delete row(s)
-</button>
-<!-- Button to export estimates table as a CSV file. -->
-<a id="estimates_export" type="button" class="btn btn-outline-primary btn-sm shiny-download-link">
- <span class="glyphicon glyphicon-download-alt"></span> Export table
-</a>