Skip to content

Commit

Permalink
Updated readme with explanation of cell numbers; used 'all' example i…
Browse files Browse the repository at this point in the history
…n Australia
  • Loading branch information
chitrams committed May 16, 2024
1 parent 90052dc commit d2b8fad
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 32 deletions.
13 changes: 6 additions & 7 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,21 @@ Here is how you would load the contact matrices in R:

```{r, results = "hide", message = FALSE}
library(readr)
url <- "https://raw.githubusercontent.com/chitrams/conmat-testing/main/output-contact-matrices/AUS_work_2015.csv"
aus_work_cm <- read_csv(url)
url <- "https://raw.githubusercontent.com/idem-lab/syncomat/main/output-contact-matrices/AUS_all_2015.csv"
aus_all_cm <- read_csv(url)
```

The following is a synthetic contact matrix for Australia in a work setting, with the columns being "age group from" and the rows being "age group to."

Each cell is the expected number of people that an individual will have contact with per day.
The following is a synthetic contact matrix for Australia in all settings, with the columns being "age group from" and the rows being "age group to."

```{r, echo = FALSE}
colnames(aus_work_cm)[1] <- "age_groups"
colnames(aus_all_cm)[1] <- "age_groups"
kable(
aus_work_cm,
aus_all_cm,
digits = 5)
```

Each cell is the expected number of people that an individual will have contact with per day. In the contact matrix above, the number 2.36549 in the first column and first row indicates that we expect a 0-5 year old to be in contact with two other 0-5 year olds per day. The number 1.27998 in the first column, seventh row (30-35 age group) indicates that a 0-5 year old is, on average, in contact with one 30-35 year old per day.

## Recreate this analysis

Expand Down
55 changes: 30 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,36 +27,41 @@ Here is how you would load the contact matrices in R:

``` r
library(readr)
url <- "https://raw.githubusercontent.com/chitrams/conmat-testing/main/output-contact-matrices/AUS_work_2015.csv"
aus_work_cm <- read_csv(url)
url <- "https://raw.githubusercontent.com/idem-lab/syncomat/main/output-contact-matrices/AUS_all_2015.csv"
aus_all_cm <- read_csv(url)
```

The following is a synthetic contact matrix for Australia in a work
setting, with the columns being “age group from” and the rows being “age
group to.”

Each cell is the expected number of people that an individual will have
contact with per day.
The following is a synthetic contact matrix for Australia in all
settings, with the columns being “age group from” and the rows being
“age group to.”

| age_groups | \[0,5) | \[5,10) | \[10,15) | \[15,20) | \[20,25) | \[25,30) | \[30,35) | \[35,40) | \[40,45) | \[45,50) | \[50,55) | \[55,60) | \[60,65) | \[65,70) | \[70,75) | \[75,80) | \[80,Inf) |
|:-----------|--------:|--------:|---------:|---------:|---------:|---------:|---------:|---------:|---------:|---------:|---------:|---------:|---------:|---------:|---------:|---------:|----------:|
| \[0,5) | 0.00310 | 0.00502 | 0.00377 | 0.00392 | 0.00787 | 0.01717 | 0.02832 | 0.03433 | 0.03542 | 0.03338 | 0.02573 | 0.01420 | 0.00584 | 0.00225 | 0.00100 | 0.00054 | 0.00040 |
| \[5,10) | 0.00485 | 0.01109 | 0.00853 | 0.00696 | 0.01466 | 0.02778 | 0.03757 | 0.03993 | 0.03988 | 0.03914 | 0.03350 | 0.02193 | 0.01107 | 0.00509 | 0.00253 | 0.00149 | 0.00114 |
| \[10,15) | 0.00356 | 0.00835 | 0.02515 | 0.02147 | 0.02929 | 0.04023 | 0.04446 | 0.04304 | 0.04236 | 0.04257 | 0.03798 | 0.02684 | 0.01560 | 0.00862 | 0.00496 | 0.00314 | 0.00242 |
| \[15,20) | 0.00381 | 0.00702 | 0.02213 | 0.09602 | 0.12146 | 0.12033 | 0.11511 | 0.10580 | 0.10273 | 0.10307 | 0.09141 | 0.06381 | 0.03770 | 0.02244 | 0.01470 | 0.01026 | 0.00779 |
| \[20,25) | 0.00825 | 0.01592 | 0.03249 | 0.13072 | 0.37074 | 0.37172 | 0.32481 | 0.28728 | 0.26990 | 0.26240 | 0.22602 | 0.15298 | 0.08822 | 0.05282 | 0.03731 | 0.02920 | 0.02396 |
| \[25,30) | 0.01904 | 0.03191 | 0.04721 | 0.13702 | 0.39327 | 0.63272 | 0.58088 | 0.49572 | 0.44618 | 0.41569 | 0.34669 | 0.22965 | 0.13026 | 0.07696 | 0.05540 | 0.04696 | 0.04645 |
| \[30,35) | 0.03143 | 0.04320 | 0.05224 | 0.13123 | 0.34403 | 0.58155 | 0.69819 | 0.61324 | 0.52718 | 0.47153 | 0.38278 | 0.25039 | 0.14116 | 0.08237 | 0.05854 | 0.05090 | 0.06445 |
| \[35,40) | 0.03679 | 0.04432 | 0.04882 | 0.11642 | 0.29373 | 0.47907 | 0.59196 | 0.66045 | 0.58371 | 0.50767 | 0.40513 | 0.26211 | 0.14616 | 0.08388 | 0.05838 | 0.05065 | 0.08354 |
| \[40,45) | 0.03711 | 0.04328 | 0.04697 | 0.11052 | 0.26978 | 0.42154 | 0.49749 | 0.57064 | 0.62333 | 0.56128 | 0.44289 | 0.28141 | 0.15273 | 0.08517 | 0.05837 | 0.05130 | 0.11066 |
| \[45,50) | 0.03434 | 0.04171 | 0.04635 | 0.10888 | 0.25753 | 0.38563 | 0.43693 | 0.48732 | 0.55112 | 0.59546 | 0.48627 | 0.29968 | 0.15627 | 0.08439 | 0.05778 | 0.05299 | 0.13848 |
| \[50,55) | 0.02577 | 0.03476 | 0.04026 | 0.09402 | 0.21600 | 0.31316 | 0.34537 | 0.37867 | 0.42345 | 0.47349 | 0.47608 | 0.30119 | 0.15127 | 0.08030 | 0.05587 | 0.05345 | 0.13383 |
| \[55,60) | 0.01341 | 0.02145 | 0.02683 | 0.06187 | 0.13781 | 0.19555 | 0.21297 | 0.23095 | 0.25363 | 0.27508 | 0.28392 | 0.22525 | 0.11858 | 0.06341 | 0.04463 | 0.04185 | 0.07457 |
| \[60,65) | 0.00497 | 0.00976 | 0.01406 | 0.03294 | 0.07163 | 0.09997 | 0.10821 | 0.11607 | 0.12407 | 0.12928 | 0.12852 | 0.10688 | 0.07603 | 0.04514 | 0.03029 | 0.02449 | 0.02453 |
| \[65,70) | 0.00164 | 0.00383 | 0.00663 | 0.01674 | 0.03661 | 0.05043 | 0.05391 | 0.05687 | 0.05907 | 0.05961 | 0.05825 | 0.04879 | 0.03854 | 0.03855 | 0.02630 | 0.01560 | 0.00799 |
| \[70,75) | 0.00058 | 0.00151 | 0.00303 | 0.00871 | 0.02055 | 0.02884 | 0.03044 | 0.03145 | 0.03216 | 0.03242 | 0.03220 | 0.02728 | 0.02055 | 0.02089 | 0.01993 | 0.00853 | 0.00246 |
| \[75,80) | 0.00024 | 0.00068 | 0.00146 | 0.00464 | 0.01227 | 0.01865 | 0.02019 | 0.02081 | 0.02156 | 0.02268 | 0.02350 | 0.01952 | 0.01267 | 0.00945 | 0.00651 | 0.00111 | 0.00016 |
| \[80,Inf) | 0.00026 | 0.00075 | 0.00161 | 0.00504 | 0.01441 | 0.02640 | 0.03659 | 0.04914 | 0.06658 | 0.08485 | 0.08422 | 0.04978 | 0.01817 | 0.00693 | 0.00269 | 0.00022 | 0.00000 |
| \[0,5) | 2.36549 | 1.32146 | 0.47311 | 0.29575 | 0.40005 | 0.77449 | 1.15301 | 0.99993 | 0.64134 | 0.47867 | 0.44268 | 0.41760 | 0.35185 | 0.26851 | 0.19701 | 0.13537 | 0.07686 |
| \[5,10) | 1.27674 | 7.34953 | 1.66447 | 0.41945 | 0.30169 | 0.48904 | 0.91914 | 1.13686 | 0.84775 | 0.57294 | 0.47211 | 0.40883 | 0.36431 | 0.32358 | 0.26286 | 0.18962 | 0.11482 |
| \[10,15) | 0.44699 | 1.63060 | 10.87195 | 1.76465 | 0.48154 | 0.39025 | 0.57920 | 0.90744 | 0.98157 | 0.72667 | 0.51018 | 0.35212 | 0.25293 | 0.22886 | 0.20394 | 0.15588 | 0.09758 |
| \[15,20) | 0.28800 | 0.42315 | 1.81674 | 9.51635 | 1.74482 | 0.68813 | 0.57022 | 0.68927 | 0.92875 | 0.96830 | 0.69633 | 0.39610 | 0.22885 | 0.18520 | 0.17954 | 0.15649 | 0.11044 |
| \[20,25) | 0.41929 | 0.32756 | 0.53419 | 1.87586 | 4.95907 | 1.74664 | 0.97801 | 0.79992 | 0.85797 | 1.06005 | 1.03984 | 0.66555 | 0.34331 | 0.22024 | 0.19820 | 0.18753 | 0.15496 |
| \[25,30) | 0.85879 | 0.56176 | 0.45801 | 0.78355 | 1.84767 | 3.01242 | 1.71204 | 1.09817 | 0.91736 | 0.96623 | 1.09704 | 0.96923 | 0.58925 | 0.32092 | 0.22601 | 0.19945 | 0.18568 |
| \[30,35) | 1.27998 | 1.05702 | 0.68055 | 0.65003 | 1.03589 | 1.71400 | 2.39046 | 1.54667 | 1.05167 | 0.91530 | 0.91991 | 0.94739 | 0.80838 | 0.50495 | 0.28419 | 0.19238 | 0.18528 |
| \[35,40) | 1.07154 | 1.26205 | 1.02924 | 0.75849 | 0.81787 | 1.06129 | 1.49302 | 2.01722 | 1.37952 | 0.99688 | 0.84227 | 0.76306 | 0.75673 | 0.67159 | 0.42916 | 0.22866 | 0.18398 |
| \[40,45) | 0.67188 | 0.92003 | 1.08839 | 0.99913 | 0.85758 | 0.86669 | 0.99245 | 1.34863 | 1.75816 | 1.26520 | 0.89163 | 0.66054 | 0.56228 | 0.60097 | 0.55999 | 0.33882 | 0.21542 |
| \[45,50) | 0.49238 | 0.61054 | 0.79116 | 1.02282 | 1.04038 | 0.89635 | 0.84813 | 0.95692 | 1.24230 | 1.60706 | 1.14430 | 0.69300 | 0.47216 | 0.43510 | 0.49951 | 0.45012 | 0.30138 |
| \[50,55) | 0.44340 | 0.48987 | 0.54087 | 0.71622 | 0.99373 | 0.99096 | 0.83001 | 0.78726 | 0.85249 | 1.11424 | 1.51131 | 0.97152 | 0.54348 | 0.39952 | 0.39560 | 0.45260 | 0.42315 |
| \[55,60) | 0.39430 | 0.39989 | 0.35189 | 0.38405 | 0.59958 | 0.82532 | 0.80580 | 0.67234 | 0.59534 | 0.63611 | 0.91582 | 1.30405 | 0.80135 | 0.48014 | 0.39168 | 0.39196 | 0.46427 |
| \[60,65) | 0.29942 | 0.32117 | 0.22782 | 0.19999 | 0.27875 | 0.45223 | 0.61969 | 0.60094 | 0.45676 | 0.39061 | 0.46175 | 0.72225 | 1.07536 | 0.70064 | 0.46088 | 0.35168 | 0.35169 |
| \[65,70) | 0.19510 | 0.24355 | 0.17600 | 0.13818 | 0.15268 | 0.21028 | 0.33049 | 0.45536 | 0.41681 | 0.30733 | 0.28981 | 0.36947 | 0.59820 | 0.98187 | 0.65803 | 0.34134 | 0.22572 |
| \[70,75) | 0.11373 | 0.15719 | 0.12460 | 0.10643 | 0.10916 | 0.11766 | 0.14778 | 0.23118 | 0.30857 | 0.28031 | 0.22799 | 0.23946 | 0.31263 | 0.52279 | 0.84829 | 0.43245 | 0.19277 |
| \[75,80) | 0.05961 | 0.08650 | 0.07265 | 0.07076 | 0.07879 | 0.07920 | 0.07631 | 0.09396 | 0.14241 | 0.19268 | 0.19897 | 0.18279 | 0.18197 | 0.20686 | 0.32988 | 0.46024 | 0.18492 |
| \[80,Inf) | 0.04845 | 0.07497 | 0.06510 | 0.07148 | 0.09319 | 0.10554 | 0.10520 | 0.10821 | 0.12961 | 0.18467 | 0.26628 | 0.30992 | 0.26048 | 0.19581 | 0.21048 | 0.26470 | 0.18688 |

Each cell is the expected number of people that an individual will have
contact with per day. In the contact matrix above, the number 2.36549 in
the first column and first row indicates that we expect a 0-5 year old
to be in contact with two other 0-5 year olds per day. The number
1.27998 in the first column, seventh row (30-35 age group) indicates
that a 0-5 year old is, on average, in contact with one 30-35 year old
per day.

## Recreate this analysis

Expand Down

0 comments on commit d2b8fad

Please sign in to comment.