From fedbd56602f503c8a17cb584dc2a8141128f8885 Mon Sep 17 00:00:00 2001 From: Mathilde Mousset Date: Tue, 8 Oct 2024 20:38:38 +0200 Subject: [PATCH] Add some functions to the cheatsheet analyses --- _quarto.yml | 2 +- cheatsheets/analyses.qmd | 27 ++++++++++++++++++++++++++- reference/analyses_sheet.qmd | 8 ++++---- 3 files changed, 31 insertions(+), 6 deletions(-) diff --git a/_quarto.yml b/_quarto.yml index 6c432d4..4f29ed4 100644 --- a/_quarto.yml +++ b/_quarto.yml @@ -103,7 +103,7 @@ website: - text: Choosing variable controls href: cheatsheets/variable_control.qmd - - text: Setup analyses + - text: Defining analyses href: cheatsheets/analyses.qmd tools: diff --git a/cheatsheets/analyses.qmd b/cheatsheets/analyses.qmd index dde5e74..9f95f2b 100644 --- a/cheatsheets/analyses.qmd +++ b/cheatsheets/analyses.qmd @@ -107,4 +107,29 @@ Example: a graph plotting the number of "Cured" and "Dead" across time is plotti ## Some functions/examples -`N`: count the number of rows for each modality \ No newline at end of file +### In the global summary + +`DATE_RANGE` is a custom funtion to display the min and max of a date variable. Example: `DATE_RANGE(visit_date)`. + +`COUNTA(case_id)`: counts the number of non empty case_id. + +`COUNTIF(hospit_yn, "Yes")` counts the number of *Yes* in the `hospit_yn` variable + + +### Count rows + +`N`: count the number of rows for each modality of a variable. The setup user defines for each analysis whether the empty cells should be added in the table (as their own categories). + + +### Calculate a CFR + +`SUM(cfr_numerator) / SUM(cfr_denominator)` to calculate a Case Fatality Rate. +- The `cfr_numerator` is a calculated variable based on the outcome column; it takes 1 for deceased patient and zero for others. +- The `cfr_denominator` is also a calculated column, which takes 1 for discharged patients and 0 for other patients. + +Don't forget to pick a percent format with appropriate rounding level. + +### Spatial analyses or spatio-temporal analyses + +For the top ten (or whichever value you chose) areas with the most cases, use `N` as the function summary. + For the top ten areas for the number of deaths, use `SUM(is_dead_01)` where `is_dead_01` here is a calculated variable that takes 1 if the patient is dead and 0 otherwhise. \ No newline at end of file diff --git a/reference/analyses_sheet.qmd b/reference/analyses_sheet.qmd index 8f7ef79..cd5aa7c 100644 --- a/reference/analyses_sheet.qmd +++ b/reference/analyses_sheet.qmd @@ -93,7 +93,7 @@ A "Note" message will be displayed in the *"\_\_checkRep*" sheet. Definition in the **setup file**: -Display in the linelist: +Display in the **linelist**: ![](../reference/images/im-067-example-univariate-analysis.png){fig-align="center"} @@ -168,7 +168,7 @@ Definition in the **setup file**: ![](../reference/images/im-069-example-bivariate-analysis.png){fig-align="center"} -Display in the linelist : +Display in the **linelist**: ![](../reference/images/im-070-example-bivariate-analysis.png){fig-align="center"} @@ -345,7 +345,7 @@ Definition in the **setup file**: ![](../reference/images/im-075-example-graph-on-time-series.png){fig-align="center"} -Display in the linelist: +Display in the **linelist**: ![](../reference/images/im-076-example-graph-on-time-series.png){fig-align="center"} @@ -408,7 +408,7 @@ Definition in the **setup file**: ![](../reference/images/im-082-example-spatial-analysis.png){fig-align="center"} -Display in the linelist: +Display in the **linelist**: ![](../reference/images/im-083-example-spatial-analysis.png){fig-align="center"}