epiverse-trace / finalsize

R package to calculate the final size of an SIR epidemic in populations with heterogeneity in social contacts and disease susceptibility
https://epiverse-trace.github.io/finalsize/
Other
11 stars 7 forks source link

Add input and output object names in code to show how they looks like #127

Closed avallecam closed 1 year ago

avallecam commented 1 year ago

About the input:

About the output:

These are the following suggestions:

> contact_data$matrix
      contact.age.group
           [0,5)   [5,18)  [18,40)  [40,65)       65+
  [1,] 1.9157895 1.467205 3.278803 1.559611 0.3658614
  [2,] 0.5191021 8.858736 3.421566 2.616146 0.6260247
  [3,] 0.6252718 1.844236 5.440972 3.492124 0.8092367
  [4,] 0.2792593 1.324010 3.278895 4.178218 1.2380907
  [5,] 0.1306272 0.631752 1.515092 2.468756 1.7142857

> contact_data$demography
   age.group population proportion year
1:     [0,5)    3453670 0.05728738 2005
2:    [5,18)    9761554 0.16191873 2005
3:   [18,40)   18110368 0.30040378 2005
4:   [40,65)   19288101 0.31993930 2005
5:       65+    9673058 0.16045081 2005
avallecam commented 1 year ago

Great! This suggestion could also be extended to these outputs in the other vignettes. They facilitate the comparability of scenarios in final_size_data, as invited in the reading of the text. In the case of final_size_immunised, it is the first output with a susceptibility matrix of two columns, which generates a tidy dataframe (not necessary to mention but is cool to see). The same for final_size_data in the uncertainty vignette.

https://github.com/epiverse-trace/finalsize/blob/f0ac4127e54579754d08ee92754203f99c0f6ee9/vignettes/varying_susceptibility.Rmd#L158-L162

> final_size_data
   demo_grp   susc_grp susceptibility p_infected      scenario
1     [0,5) susc_grp_1            0.2 0.08438181 Heterogeneous
2    [5,18) susc_grp_1            0.5 0.39000734 Heterogeneous
3   [18,40) susc_grp_1            0.6 0.35635678 Heterogeneous
4   [40,65) susc_grp_1            0.9 0.43945122 Heterogeneous
5       65+ susc_grp_1            1.0 0.32834904 Heterogeneous
6     [0,5) susc_grp_1            1.0 0.64348986       Uniform
7    [5,18) susc_grp_1            1.0 0.87774777       Uniform
8   [18,40) susc_grp_1            1.0 0.77233709       Uniform
9   [40,65) susc_grp_1            1.0 0.70232650       Uniform
10      65+ susc_grp_1            1.0 0.51318727       Uniform

https://github.com/epiverse-trace/finalsize/blob/f0ac4127e54579754d08ee92754203f99c0f6ee9/vignettes/varying_susceptibility.Rmd#L272-L281

> final_size_immunised
   demo_grp     susc_grp susceptibility p_infected
1     [0,5) Un-immunised          0.200 0.05090418
2    [5,18) Un-immunised          0.500 0.25527773
3   [18,40) Un-immunised          0.600 0.23095861
4   [40,65) Un-immunised          0.900 0.29266225
5       65+ Un-immunised          1.000 0.21153844
6     [0,5)    Immunised          0.150 0.03842637
7    [5,18)    Immunised          0.375 0.19832977
8   [18,40)    Immunised          0.450 0.17877476
9   [40,65)    Immunised          0.675 0.22870569
10      65+    Immunised          0.750 0.16326990

https://github.com/epiverse-trace/finalsize/blob/f0ac4127e54579754d08ee92754203f99c0f6ee9/vignettes/uncertainty_params.Rmd#L145

> final_size_data
      demo_grp   susc_grp susceptibility p_infected replicate r0_estimate
   1:    [0,5) susc_grp_1              1  0.6182474         1    1.927639
   2:   [5,18) susc_grp_1              1  0.8612644         1    1.927639
   3:  [18,40) susc_grp_1              1  0.7489203         1    1.927639
   4:  [40,65) susc_grp_1              1  0.6768969         1    1.927639
   5:      65+ susc_grp_1              1  0.4880345         1    1.927639
  ---                                                                    
4996:    [0,5) susc_grp_1              1  0.6037438      1000    1.888608
4997:   [5,18) susc_grp_1              1  0.8513187      1000    1.888608
4998:  [18,40) susc_grp_1              1  0.7351487      1000    1.888608
4999:  [40,65) susc_grp_1              1  0.6621470      1000    1.888608
5000:      65+ susc_grp_1              1  0.4738339      1000    1.888608