Code
targets::tar_read(plotdata_racegender) |>
plot_bar() +
theme_mpxnyc_bar() +
scale_axis_mpxnyc() +
scale_fill_mpxnyc(name = "Race / gender") +
theme_mpxnyc_nomargin()
targets::tar_read(plotdata_racegender) |>
plot_bar() +
theme_mpxnyc_bar() +
scale_axis_mpxnyc() +
scale_fill_mpxnyc(name = "Race / gender") +
theme_mpxnyc_nomargin()
targets::tar_read(plotdata_racegender) |>
draw_table_1("Race-Gender")| Race-Gender | ||
|---|---|---|
| (MPX NYC, 2022) | ||
| N | % (CI) | |
| Another demographic | 26 | 2% (1-3) |
| Black cisgender man | 131 | 10% (8-12) |
| Cisgender woman | 62 | 5% (4-6) |
| Latinx cisgender man | 198 | 15% (13-17) |
| Non binary | 96 | 7% (6-9) |
| Other cisgender man | 176 | 13% (12-15) |
| Transgender man | 34 | 3% (2-3) |
| Transgender woman | 29 | 2% (1-3) |
| White cisgender man | 552 | 42% (40-45) |
targets::tar_read(plotdata_age) |>
plot_bar() +
theme_mpxnyc_bar() +
scale_axis_mpxnyc() +
scale_fill_mpxnyc(name = "Age group") +
theme_mpxnyc_nomargin()
targets::tar_read(plotdata_age) |>
draw_table_1("Age")| Age | ||
|---|---|---|
| (MPX NYC, 2022) | ||
| N | % (CI) | |
| 18-24 | 195 | 15% (13-17) |
| 25-34 | 538 | 41% (39-44) |
| 35-44 | 325 | 25% (23-27) |
| 45-54 | 145 | 11% (9-13) |
| 55+ | 101 | 8% (6-9) |
targets::tar_read(plotdata_channel) |>
plot_bar() +
theme_mpxnyc_bar() +
scale_axis_mpxnyc() +
scale_fill_mpxnyc(name = "Recruitment\nchannel") +
theme_mpxnyc_nomargin()
targets::tar_read(plotdata_channel) |>
draw_table_1("Channel")| Channel | ||
|---|---|---|
| (MPX NYC, 2022) | ||
| N | % (CI) | |
| Grindr | 706 | 54% (51-57) |
| 112 | 9% (7-10) | |
| Partner toolkit | 142 | 11% (9-13) |
| 62 | 5% (4-6) | |
| Unknown | 282 | 22% (19-24) |
targets::tar_read(plotdata_genderid) |>
plot_bar() +
theme_mpxnyc_bar() +
scale_axis_mpxnyc("MPX NYC sample proportion") +
scale_fill_mpxnyc(name = "Gender\nmodality") +
theme_mpxnyc_nomargin()
targets::tar_read(plotdata_genderid) |>
draw_table_1("Gender")| Gender | ||
|---|---|---|
| (MPX NYC, 2022) | ||
| N | % (CI) | |
| Another Demographic | 26 | 2% (1-3) |
| Cisgender Man | 1057 | 81% (79-83) |
| Cisgender Woman | 62 | 5% (4-6) |
| Non Binary | 96 | 7% (6-9) |
| Transgender Man | 34 | 3% (2-3) |
| Transgender Woman | 29 | 2% (1-3) |
targets::tar_read(plotdata_sexorientation) |>
plot_bar() +
theme_mpxnyc_bar() +
scale_axis_mpxnyc() +
scale_fill_mpxnyc(name = "Sexual\norientation") +
theme_mpxnyc_nomargin()
targets::tar_read(plotdata_sexorientation) |>
draw_table_1("Sexual Orientation")| Sexual Orientation | ||
|---|---|---|
| (MPX NYC, 2022) | ||
| N | % (CI) | |
| Bisexual | 186 | 14% (12-16) |
| Gay | 860 | 66% (63-68) |
| Queer | 159 | 12% (10-14) |
| Something Else | 35 | 3% (2-4) |
| Straight | 64 | 5% (4-6) |
targets::tar_read(plotdata_groupsex) |>
plot_bar() +
theme_mpxnyc_bar() +
scale_axis_mpxnyc() +
scale_fill_mpxnyc(name = "Group contact") +
theme_mpxnyc_nomargin()
targets::tar_read(plotdata_groupsex) |>
draw_table_1("Group Sex / Contact past 4 weeks") | Group Sex / Contact past 4 weeks | ||
|---|---|---|
| (MPX NYC, 2022) | ||
| N | % (CI) | |
| No | 774 | 59% (57-62) |
| Yes | 530 | 41% (38-43) |
targets::tar_read(plotdata_race) |>
plot_bar() +
theme_mpxnyc_bar() +
scale_axis_mpxnyc() +
scale_fill_mpxnyc(name = "Race") +
theme_mpxnyc_nomargin()
targets::tar_read(plotdata_race) |>
draw_table_1("Race")| Race | ||
|---|---|---|
| (MPX NYC, 2022) | ||
| N | % (CI) | |
| Another Group | 57 | 4% (3-5) |
| Asian | 84 | 6% (5-8) |
| Black | 156 | 12% (10-14) |
| Latinx | 231 | 18% (16-20) |
| Multi Racial | 79 | 6% (5-7) |
| White | 695 | 53% (51-56) |
targets::tar_read(plotdata_sexorientation_racegender) |>
plot_radar_grid() +
scale_radial_mpxnyc() +
scale_fill_mpxnyc(name = "") +
theme_mpxnyc_radar_people() +
theme_mpxnyc_nomargin()
targets::tar_read(plotdata_sexorientation_racegender) |>
draw_table_2("Sexual Orientation by Race-Gender") | Sexual Orientation by Race-Gender | ||
|---|---|---|
| (MPX NYC, 2022) | ||
| N | % (CI) | |
| Another demographic | ||
| Bisexual | 3 | 12% (3-26) |
| Gay | 5 | 19% (5-35) |
| Queer | 11 | 42% (24-62) |
| Something Else | 6 | 23% (7-39) |
| Straight | 1 | 4% (3-15) |
| Black cisgender man | ||
| Bisexual | 24 | 18% (12-25) |
| Gay | 88 | 67% (59-76) |
| Queer | 9 | 7% (3-11) |
| Something Else | 4 | 3% (1-6) |
| Straight | 6 | 5% (1-9) |
| Cisgender woman | ||
| Bisexual | 19 | 31% (20-42) |
| Gay | 4 | 6% (2-13) |
| Queer | 16 | 26% (15-37) |
| Straight | 23 | 37% (25-49) |
| Latinx cisgender man | ||
| Bisexual | 24 | 12% (8-17) |
| Gay | 158 | 80% (74-86) |
| Queer | 9 | 5% (2-8) |
| Something Else | 2 | 1% (0-3) |
| Straight | 5 | 3% (1-5) |
| Non binary | ||
| Bisexual | 18 | 19% (12-26) |
| Gay | 24 | 25% (17-34) |
| Queer | 53 | 55% (45-65) |
| Something Else | 1 | 1% (1-4) |
| Other cisgender man | ||
| Bisexual | 24 | 14% (9-19) |
| Gay | 136 | 77% (71-83) |
| Queer | 10 | 6% (2-9) |
| Straight | 6 | 3% (1-6) |
| Transgender man | ||
| Bisexual | 10 | 29% (13-46) |
| Gay | 7 | 21% (9-35) |
| Queer | 14 | 41% (24-59) |
| Something Else | 1 | 3% (2-11) |
| Straight | 2 | 6% (2-15) |
| Transgender woman | ||
| Bisexual | 7 | 24% (11-39) |
| Gay | 3 | 10% (3-24) |
| Queer | 4 | 14% (4-29) |
| Something Else | 6 | 21% (7-37) |
| Straight | 9 | 31% (15-50) |
| White cisgender man | ||
| Bisexual | 57 | 10% (8-13) |
| Gay | 435 | 79% (75-82) |
| Queer | 33 | 6% (4-8) |
| Something Else | 15 | 3% (1-4) |
| Straight | 12 | 2% (1-3) |
targets::tar_read(plotdata_hivprep_racegender) |>
plot_radar_grid() +
scale_radial_mpxnyc() +
scale_fill_mpxnyc(name = "") +
theme_mpxnyc_radar_people() +
theme_mpxnyc_nomargin()
targets::tar_read(plotdata_hivprep_racegender) |>
draw_table_2("HIV and PrEP Status by Race-Gender") | HIV and PrEP Status by Race-Gender | ||
|---|---|---|
| (MPX NYC, 2022) | ||
| N | % (CI) | |
| Another demographic | ||
| No | 11 | 48% (23-61) |
| Yes | 12 | 52% (26-65) |
| Black cisgender man | ||
| No | 56 | 62% (34-51) |
| Yes | 34 | 38% (19-33) |
| Cisgender woman | ||
| No | 61 | 100% (94-100) |
| Latinx cisgender man | ||
| No | 95 | 56% (41-55) |
| Yes | 74 | 44% (31-44) |
| Non binary | ||
| No | 62 | 68% (55-73) |
| Yes | 29 | 32% (22-40) |
| Other cisgender man | ||
| No | 92 | 56% (45-60) |
| Yes | 73 | 44% (34-49) |
| Transgender man | ||
| No | 23 | 68% (50-82) |
| Yes | 11 | 32% (18-50) |
| Transgender woman | ||
| No | 16 | 64% (37-72) |
| Yes | 9 | 36% (14-49) |
| White cisgender man | ||
| No | 242 | 48% (39-48) |
| Yes | 263 | 52% (44-52) |
targets::tar_read(plotdata_mpoxvax_racegender) |>
plot_radar_grid() +
scale_radial_mpxnyc() +
scale_fill_mpxnyc(name = "") +
theme_mpxnyc_radar_people() +
theme_mpxnyc_nomargin()
targets::tar_read(plotdata_mpoxvax_racegender) |>
draw_table_2( "Mpox Vax Status by Race-Gender") | Mpox Vax Status by Race-Gender | ||
|---|---|---|
| (MPX NYC, 2022) | ||
| N | % (CI) | |
| Another demographic | ||
| No | 8 | 31% (14-48) |
| Unsure | 1 | 4% (3-15) |
| Yes | 17 | 65% (48-83) |
| Black cisgender man | ||
| No | 50 | 38% (29-46) |
| Yes | 81 | 62% (54-71) |
| Cisgender woman | ||
| No | 51 | 82% (73-91) |
| Unsure | 1 | 2% (1-6) |
| Yes | 10 | 16% (7-25) |
| Latinx cisgender man | ||
| No | 77 | 39% (32-46) |
| Yes | 121 | 61% (54-68) |
| Non binary | ||
| No | 32 | 33% (24-43) |
| Unsure | 1 | 1% (1-4) |
| Yes | 63 | 66% (56-75) |
| Other cisgender man | ||
| No | 51 | 29% (22-36) |
| Unsure | 2 | 1% (1-3) |
| Yes | 123 | 70% (63-77) |
| Transgender man | ||
| No | 10 | 29% (15-46) |
| Yes | 24 | 71% (54-85) |
| Transgender woman | ||
| No | 17 | 59% (41-77) |
| Unsure | 1 | 3% (3-12) |
| Yes | 11 | 38% (20-56) |
| White cisgender man | ||
| No | 131 | 24% (20-27) |
| Unsure | 1 | 0% (0-1) |
| Yes | 420 | 76% (73-80) |
targets::tar_read(plotdata_placetype_bar_grid) |>
dplyr::mutate(proportion = abs(proportion)) |>
plot_bar_stratified2() +
ggplot2::coord_polar() +
scale_axis_mpxnyc() +
ggplot2::scale_y_continuous(limits = c(-0.3, 0.84)) +
scale_fill_mpxnyc(name = "") +
ggplot2::geom_label(ggplot2::aes(label = scales::percent(proportion, accuracy = 1), x = level, y = 0.5 ), border.color = "white", label.size = 0, size = 3.5) +
theme_mpxnyc_bar_places(
plot.margin = ggplot2::unit(c(0,0,0,0), "cm"),
panel.spacing = ggplot2::unit(0, "cm"),
legend.position = "bottom",
panel.grid.major.y = ggplot2::element_blank(),
panel.grid.major.x = ggplot2::element_blank(),
axis.text.x = ggplot2::element_blank(),
strip.text.y.left = ggplot2::element_text(angle = 90)
)
targets::tar_read(plotdata_placetype_distancefromhome_placeSex) |>
draw_table_3("Venue type by home distance and sexual contact")| Venue type by home distance and sexual contact | ||
|---|---|---|
| (MPX NYC, 2022) | ||
| N | % (CI) | |
| Different Borough - Did not have sex | ||
| Concert/Theatre/Show | 23 | 22% (14-30) |
| Dance Party | 50 | 47% (37-56) |
| Dark Room/Sex Party | 4 | 4% (1-8) |
| Private Residence | 8 | 8% (3-14) |
| Something Else | 13 | 12% (6-19) |
| Sport Game | 8 | 8% (3-13) |
| Different Borough - Had sex | ||
| Concert/Theatre/Show | 3 | 3% (1-7) |
| Dance Party | 14 | 15% (8-22) |
| Dark Room/Sex Party | 25 | 27% (18-36) |
| Private Residence | 39 | 41% (30-53) |
| Something Else | 12 | 13% (6-21) |
| Sport Game | 1 | 1% (1-4) |
| Same Borough - Did not have sex | ||
| Concert/Theatre/Show | 35 | 30% (21-40) |
| Dance Party | 43 | 37% (29-47) |
| Dark Room/Sex Party | 3 | 3% (1-6) |
| Private Residence | 10 | 9% (4-14) |
| Something Else | 21 | 18% (11-26) |
| Sport Game | 4 | 3% (1-7) |
| Same Borough - Had sex | ||
| Concert/Theatre/Show | 1 | 1% (1-3) |
| Dance Party | 13 | 11% (6-17) |
| Dark Room/Sex Party | 19 | 17% (10-24) |
| Private Residence | 63 | 55% (46-65) |
| Something Else | 18 | 16% (10-22) |
| Same Community District - Did not have sex | ||
| Concert/Theatre/Show | 5 | 12% (3-23) |
| Dance Party | 17 | 40% (25-56) |
| Dark Room/Sex Party | 3 | 7% (2-16) |
| Private Residence | 10 | 24% (11-39) |
| Something Else | 6 | 14% (5-25) |
| Sport Game | 1 | 2% (2-9) |
| Same Community District - Had sex | ||
| Dance Party | 6 | 4% (1-8) |
| Dark Room/Sex Party | 8 | 6% (2-10) |
| Private Residence | 120 | 83% (77-89) |
| Something Else | 10 | 7% (3-11) |
targets::tar_read(plotdata_age_mixing_matrix) |>
plot_matrix_mixing() +
scale_fill_mpxnyc_gradient("Spatial\nmixing\ncoefficient", labels = scales::label_percent(), breaks = c(-0.5, 0, 0.5, 1), limits = c(-0.5, 1)) +
scale_color_mpxnyc_gradient() +
ggplot2::scale_alpha_discrete(guide = "none") +
theme_mpxnyc_mixing()
targets::tar_read(plotdata_racegender_mixing_matrix) |>
dplyr::filter(ego_level != "Another demographic", alter_level != "Another demographic") |>
plot_matrix_mixing() +
scale_fill_mpxnyc_gradient("Spatial\nmixing\ncoefficient", labels = scales::label_percent(), breaks = c(-2, 0, 2), limits = c(-2, 2)) +
scale_color_mpxnyc_gradient() +
ggplot2::scale_alpha_discrete(guide = "none") +
theme_mpxnyc_mixing()
targets::tar_read(plotdata_sexorientation_mixing_matrix) |>
dplyr::filter(ego_level != "Something Else", alter_level != "Something Else") |>
plot_matrix_mixing() +
scale_fill_mpxnyc_gradient("Spatial\nmixing\ncoefficient", labels = scales::label_percent(), breaks = c(-0.5, 0, 0.5, 1), limits = c(-0.5, 1.2)) +
scale_color_mpxnyc_gradient() +
ggplot2::scale_alpha_discrete(guide = "none") +
theme_mpxnyc_mixing()