case_id | generation | date_infection | date_onset | date_hospitalisation | date_outcome | outcome | gender | age | age_unit | age_years | age_cat | age_cat5 | hospital | lon | lat | infector | source | wt_kg | ht_cm | ct_blood | fever | chills | cough | aches | vomit | temp | time_admission | bmi | days_onset_hosp |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5fe599 | 4 | 2014-05-08 | 2014-05-13 | 2014-05-15 | m | 2 | years | 2 | 0-4 | 0-4 | Other | -13.21574 | 8.468973 | f547d6 | other | 27 | 48 | 22 | no | no | yes | no | yes | 36.8 | 117.18750 | 2 | |||
8689b7 | 4 | 2014-05-13 | 2014-05-14 | 2014-05-18 | Recover | f | 3 | years | 3 | 0-4 | 0-4 | Missing | -13.21523 | 8.451719 | 25 | 59 | 22 | 36.9 | 09:36 | 71.81844 | 1 | ||||||||
11f8ea | 2 | 2014-05-16 | 2014-05-18 | 2014-05-30 | Recover | m | 56 | years | 56 | 50-69 | 55-59 | St. Mark's Maternity Hospital (SMMH) | -13.21291 | 8.464817 | 91 | 238 | 21 | 36.9 | 16:48 | 16.06525 | 2 | ||||||||
b8812a | 3 | 2014-05-04 | 2014-05-18 | 2014-05-20 | f | 18 | years | 18 | 15-19 | 15-19 | Port Hospital | -13.23637 | 8.475476 | f90f5f | other | 41 | 135 | 23 | no | no | no | no | no | 36.8 | 11:22 | 22.49657 | 2 | ||
893f25 | 3 | 2014-05-18 | 2014-05-21 | 2014-05-22 | 2014-05-29 | Recover | m | 3 | years | 3 | 0-4 | 0-4 | Military Hospital | -13.22286 | 8.460824 | 11f8ea | other | 36 | 71 | 23 | no | no | yes | no | yes | 36.9 | 12:60 | 71.41440 | 1 |
be99c8 | 3 | 2014-05-03 | 2014-05-22 | 2014-05-23 | 2014-05-24 | Recover | f | 16 | years | 16 | 15-19 | 15-19 | Port Hospital | -13.22263 | 8.461831 | aec8ec | other | 56 | 116 | 21 | no | no | yes | no | yes | 37.6 | 14:13 | 41.61712 | 1 |
07e3e8 | 4 | 2014-05-22 | 2014-05-27 | 2014-05-29 | 2014-06-01 | Recover | f | 16 | years | 16 | 15-19 | 15-19 | Missing | -13.23315 | 8.462729 | 893f25 | other | 47 | 87 | 21 | 37.3 | 14:33 | 62.09539 | 2 | |||||
369449 | 4 | 2014-05-28 | 2014-06-02 | 2014-06-03 | 2014-06-07 | Death | f | 0 | years | 0 | 0-4 | 0-4 | Missing | -13.23210 | 8.461444 | 133ee7 | other | 0 | 11 | 22 | no | no | yes | no | yes | 37.0 | 09:25 | 0.00000 | 1 |
f393b4 | 4 | 2014-06-05 | 2014-06-06 | 2014-06-18 | Recover | m | 61 | years | 61 | 50-69 | 60-64 | Missing | -13.22255 | 8.461913 | 86 | 226 | 22 | no | no | yes | no | yes | 36.4 | 11:16 | 16.83765 | 1 | |||
1389ca | 4 | 2014-06-05 | 2014-06-07 | 2014-06-09 | Death | f | 27 | years | 27 | 20-29 | 25-29 | Missing | -13.25722 | 8.472923 | 69 | 174 | 22 | no | no | yes | no | no | 35.9 | 10:55 | 22.79033 | 2 |
Sample Ebola Surveillance Report
1 Importing Datset
2 EDA
2.1 View First 10 Sets
2.2 Using skimr() Package
| Name | linelist |
| Number of rows | 5888 |
| Number of columns | 30 |
| _______________________ | |
| Column type frequency: | |
| character | 13 |
| Date | 4 |
| factor | 2 |
| numeric | 11 |
| ________________________ | |
| Group variables | None |
Variable type: character
| skim_variable | n_missing | complete_rate | min | max | empty | n_unique | whitespace |
|---|---|---|---|---|---|---|---|
| case_id | 0 | 1.00 | 6 | 6 | 0 | 5888 | 0 |
| outcome | 1323 | 0.78 | 5 | 7 | 0 | 2 | 0 |
| gender | 278 | 0.95 | 1 | 1 | 0 | 2 | 0 |
| age_unit | 0 | 1.00 | 5 | 6 | 0 | 2 | 0 |
| hospital | 0 | 1.00 | 5 | 36 | 0 | 6 | 0 |
| infector | 2088 | 0.65 | 6 | 6 | 0 | 2697 | 0 |
| source | 2088 | 0.65 | 5 | 7 | 0 | 2 | 0 |
| fever | 249 | 0.96 | 2 | 3 | 0 | 2 | 0 |
| chills | 249 | 0.96 | 2 | 3 | 0 | 2 | 0 |
| cough | 249 | 0.96 | 2 | 3 | 0 | 2 | 0 |
| aches | 249 | 0.96 | 2 | 3 | 0 | 2 | 0 |
| vomit | 249 | 0.96 | 2 | 3 | 0 | 2 | 0 |
| time_admission | 765 | 0.87 | 5 | 5 | 0 | 1072 | 0 |
Variable type: Date
| skim_variable | n_missing | complete_rate | min | max | median | n_unique |
|---|---|---|---|---|---|---|
| date_infection | 2087 | 0.65 | 2014-03-19 | 2015-04-27 | 2014-10-11 | 359 |
| date_onset | 256 | 0.96 | 2014-04-07 | 2015-04-30 | 2014-10-23 | 367 |
| date_hospitalisation | 0 | 1.00 | 2014-04-17 | 2015-04-30 | 2014-10-23 | 363 |
| date_outcome | 936 | 0.84 | 2014-04-19 | 2015-06-04 | 2014-11-01 | 371 |
Variable type: factor
| skim_variable | n_missing | complete_rate | ordered | n_unique | top_counts |
|---|---|---|---|---|---|
| age_cat | 86 | 0.99 | FALSE | 8 | 0-4: 1095, 5-9: 1095, 20-: 1073, 10-: 941 |
| age_cat5 | 86 | 0.99 | FALSE | 17 | 0-4: 1095, 5-9: 1095, 10-: 941, 15-: 743 |
Variable type: numeric
| skim_variable | n_missing | complete_rate | mean | sd | p0 | p25 | p50 | p75 | p100 | hist |
|---|---|---|---|---|---|---|---|---|---|---|
| generation | 0 | 1.00 | 16.56 | 5.79 | 0.00 | 13.00 | 16.00 | 20.00 | 37.00 | ▁▆▇▂▁ |
| age | 86 | 0.99 | 16.07 | 12.62 | 0.00 | 6.00 | 13.00 | 23.00 | 84.00 | ▇▅▁▁▁ |
| age_years | 86 | 0.99 | 16.02 | 12.64 | 0.00 | 6.00 | 13.00 | 23.00 | 84.00 | ▇▅▁▁▁ |
| lon | 0 | 1.00 | -13.23 | 0.02 | -13.27 | -13.25 | -13.23 | -13.22 | -13.21 | ▅▃▃▆▇ |
| lat | 0 | 1.00 | 8.47 | 0.01 | 8.45 | 8.46 | 8.47 | 8.48 | 8.49 | ▅▇▇▇▆ |
| wt_kg | 0 | 1.00 | 52.64 | 18.58 | -11.00 | 41.00 | 54.00 | 66.00 | 111.00 | ▁▃▇▅▁ |
| ht_cm | 0 | 1.00 | 124.96 | 49.52 | 4.00 | 91.00 | 129.00 | 159.00 | 295.00 | ▂▅▇▂▁ |
| ct_blood | 0 | 1.00 | 21.21 | 1.69 | 16.00 | 20.00 | 22.00 | 22.00 | 26.00 | ▁▃▇▃▁ |
| temp | 149 | 0.97 | 38.56 | 0.98 | 35.20 | 38.20 | 38.80 | 39.20 | 40.80 | ▁▂▂▇▁ |
| bmi | 0 | 1.00 | 46.89 | 55.39 | -1200.00 | 24.56 | 32.12 | 50.01 | 1250.00 | ▁▁▇▁▁ |
| days_onset_hosp | 256 | 0.96 | 2.06 | 2.26 | 0.00 | 1.00 | 1.00 | 3.00 | 22.00 | ▇▁▁▁▁ |
2.3 Summary Statistics
Min. 1st Qu. Median Mean 3rd Qu. Max. NA's
0.00 6.00 13.00 16.02 23.00 84.00 86
[1] 6
3 Discribing Tables
3.1 Using Janitor Package
Simple Tabyl
age_cat | n | percent | valid_percent |
|---|---|---|---|
0-4 | 1,095 | 0.185971467 | 0.188728025 |
5-9 | 1,095 | 0.185971467 | 0.188728025 |
10-14 | 941 | 0.159816576 | 0.162185453 |
15-19 | 743 | 0.126188859 | 0.128059290 |
20-29 | 1,073 | 0.182235054 | 0.184936229 |
30-49 | 754 | 0.128057065 | 0.129955188 |
50-69 | 95 | 0.016134511 | 0.016373664 |
70+ | 6 | 0.001019022 | 0.001034126 |
86 | 0.014605978 |
Cross-tabulation
age_cat | f | m | NA_ |
|---|---|---|---|
0-4 | 640 | 416 | 39 |
5-9 | 641 | 412 | 42 |
10-14 | 518 | 383 | 40 |
15-19 | 359 | 364 | 20 |
20-29 | 468 | 575 | 30 |
30-49 | 179 | 557 | 18 |
50-69 | 2 | 91 | 2 |
70+ | 0 | 5 | 1 |
0 | 0 | 86 |
Adorning the tables
age_cat | n | percent | valid_percent |
|---|---|---|---|
0-4 | 1,095 | 18.6% | 18.9% |
5-9 | 1,095 | 18.6% | 18.9% |
10-14 | 941 | 16.0% | 16.2% |
15-19 | 743 | 12.6% | 12.8% |
20-29 | 1,073 | 18.2% | 18.5% |
30-49 | 754 | 12.8% | 13.0% |
50-69 | 95 | 1.6% | 1.6% |
70+ | 6 | 0.1% | 0.1% |
86 | 1.5% | - |
A cross-tabulation adjusted to capture both count and percentage
Age Category/Gender | f | m | NA_ | Total |
|---|---|---|---|---|
0-4 | 640 (22.8%) | 416 (14.8%) | 39 (14.0%) | 1,095 (18.6%) |
5-9 | 641 (22.8%) | 412 (14.7%) | 42 (15.1%) | 1,095 (18.6%) |
10-14 | 518 (18.5%) | 383 (13.7%) | 40 (14.4%) | 941 (16.0%) |
15-19 | 359 (12.8%) | 364 (13.0%) | 20 (7.2%) | 743 (12.6%) |
20-29 | 468 (16.7%) | 575 (20.5%) | 30 (10.8%) | 1,073 (18.2%) |
30-49 | 179 (6.4%) | 557 (19.9%) | 18 (6.5%) | 754 (12.8%) |
50-69 | 2 (0.1%) | 91 (3.2%) | 2 (0.7%) | 95 (1.6%) |
70+ | 0 (0.0%) | 5 (0.2%) | 1 (0.4%) | 6 (0.1%) |
0 (0.0%) | 0 (0.0%) | 86 (30.9%) | 86 (1.5%) |
Use of other variables
hospital | n |
|---|---|
Central Hospital | 454 |
Military Hospital | 896 |
Missing | 1,469 |
Other | 885 |
Port Hospital | 1,762 |
St. Mark's Maternity Hospital (SMMH) | 422 |
Total | 5,888 |
Saving the tabyl
Statistics MORE DETAILS WILL BE NEXT
Pearson's Chi-squared test
data: age_by_outcome
X-squared = 6.4931, df = 7, p-value = 0.4835
3.2 Usibg Dplr Package
Get Counts
íf you want to get counts of a variable, you can use the count() function from dplyr. This is similar to tabyl() but does not include percentages or totals.
age_cat | n_rows |
|---|---|
0-4 | 1,095 |
5-9 | 1,095 |
10-14 | 941 |
15-19 | 743 |
20-29 | 1,073 |
30-49 | 754 |
50-69 | 95 |
70+ | 6 |
86 |
age_cat | n |
|---|---|
0-4 | 1,095 |
5-9 | 1,095 |
10-14 | 941 |
15-19 | 743 |
20-29 | 1,073 |
30-49 | 754 |
50-69 | 95 |
70+ | 6 |
86 |
Proportion
age_cat | n | percent |
|---|---|---|
0-4 | 1,095 | 18.60% |
5-9 | 1,095 | 18.60% |
10-14 | 941 | 15.98% |
15-19 | 743 | 12.62% |
20-29 | 1,073 | 18.22% |
30-49 | 754 | 12.81% |
50-69 | 95 | 1.61% |
70+ | 6 | 0.10% |
86 | 1.46% |
age_cat | n | percent |
|---|---|---|
0-4 | 1,095 | 18.60% |
5-9 | 1,095 | 18.60% |
10-14 | 941 | 15.98% |
15-19 | 743 | 12.62% |
20-29 | 1,073 | 18.22% |
30-49 | 754 | 12.81% |
50-69 | 95 | 1.61% |
70+ | 6 | 0.10% |
86 | 1.46% |
Calculate proportion within groups
outcome | age_cat | n | percent |
|---|---|---|---|
Death | 0-4 | 471 | 18.242% |
Death | 5-9 | 476 | 18.435% |
Death | 10-14 | 438 | 16.964% |
Death | 15-19 | 323 | 12.510% |
Death | 20-29 | 477 | 18.474% |
Death | 30-49 | 329 | 12.742% |
Death | 50-69 | 33 | 1.278% |
Death | 70+ | 3 | 0.116% |
Death | 32 | 1.239% | |
Recover | 0-4 | 364 | 18.36% |
Recover | 5-9 | 391 | 19.72% |
Recover | 10-14 | 303 | 15.28% |
Recover | 15-19 | 251 | 12.66% |
Recover | 20-29 | 367 | 18.51% |
Recover | 30-49 | 238 | 12.00% |
Recover | 50-69 | 38 | 1.92% |
Recover | 70+ | 3 | 0.15% |
Recover | 28 | 1.41% | |
0-4 | 260 | 19.652% | |
5-9 | 228 | 17.234% | |
10-14 | 200 | 15.117% | |
15-19 | 169 | 12.774% | |
20-29 | 229 | 17.309% | |
30-49 | 187 | 14.135% | |
50-69 | 24 | 1.814% | |
26 | 1.965% |
Plot
Summary Statisitics
hospital | cases | delay_max | delay_mean | delay_sd | delay_3 | pct_delay_3 |
|---|---|---|---|---|---|---|
Central Hospital | 454 | 12 | 1.89 | 1.95 | 108 | 24% |
Military Hospital | 896 | 15 | 2.12 | 2.36 | 253 | 28% |
Missing | 1,469 | 22 | 2.08 | 2.29 | 399 | 27% |
Other | 885 | 18 | 2.05 | 2.23 | 234 | 26% |
Port Hospital | 1,762 | 16 | 2.05 | 2.24 | 470 | 27% |
St. Mark's Maternity Hospital (SMMH) | 422 | 18 | 2.08 | 2.33 | 116 | 27% |
Conditional Statistics
hospital | max_tem_fever | max_tem_no_fever |
|---|---|---|
Central Hospital | 40.4 | 38.0 |
Military Hospital | 40.5 | 38.0 |
Missing | 40.6 | 38.0 |
Other | 40.8 | 37.9 |
Port Hospital | 40.6 | 38.0 |
St. Mark's Maternity Hospital (SMMH) | 40.6 | 37.9 |