Skip to content

Commit

Permalink
Add some functions to the cheatsheet analyses
Browse files Browse the repository at this point in the history
  • Loading branch information
MathildeMousset committed Oct 8, 2024
1 parent 39c4707 commit fedbd56
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 6 deletions.
2 changes: 1 addition & 1 deletion _quarto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
27 changes: 26 additions & 1 deletion cheatsheets/analyses.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -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
### 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.
8 changes: 4 additions & 4 deletions reference/analyses_sheet.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -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"}

Expand Down Expand Up @@ -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"}

Expand Down Expand Up @@ -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"}

Expand Down Expand Up @@ -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"}

Expand Down

0 comments on commit fedbd56

Please sign in to comment.