Skip to content
Snippets Groups Projects
Commit 12712cd7 authored by lea.douchet_ird.fr's avatar lea.douchet_ird.fr
Browse files

Change maps

parent a64e1125
No related branches found
No related tags found
No related merge requests found
Pipeline #1085 passed
......@@ -49,6 +49,17 @@ In epidemiology, the true meaning of point is very questionable. If it usually g
# Aggregate cases over districts
district$cases <- lengths(st_intersects(district, cases))
# Plot number of cases using proportional symbol
mf_map(x = district)
mf_map(
x = district,
var = "cases",
val_max = 50,
type = "prop",
col = "#990000",
leg_title = "Cases")
mf_layout(title = "Number of cases of W Fever")
```
The incidence ($\frac{cases}{population}$) expressed per 100,000 population is commonly use to represent cases distribution related to population density but other indicators exists. As example, the standardized incidence ratios (SIRs) represent the deviation of observed and expected number of cases and is expressed as $SIR = \frac{Y_i}{E_i}$ with $Y_i$, the observed number of cases and $E_i$, the expected number of cases. In this study, we computed the expected number of cases in each district by assuming infections are homogeneously distributed across Cambodia, i.e., the incidence is the same in each district. The SIR therefore represents the deviation of incidence compared to the average incidence across Cambodia.
......@@ -68,40 +79,33 @@ district$expected <- district$T_POP * rate
district$SIR <- district$cases / district$expected
```
```{r inc_visualization, eval = TRUE, echo = TRUE, nm = TRUE, fig.width=8, fig.height=4, class.output="code-out", warning=FALSE, message=FALSE}
par(mfrow = c(1, 3))
# Plot number of cases using proportional symbol
mf_map(x = district)
mf_map(
x = district,
var = "cases",
val_max = 50,
type = "prop",
col = "#990000",
leg_title = "Cases")
mf_layout(title = "Number of cases of W Fever")
```{r inc_visualization, eval = TRUE, echo = TRUE, nm = TRUE, fig.width=11, fig.height=7, class.output="code-out", warning=FALSE, message=FALSE}
par(mfrow = c(1, 2))
# Plot incidence
mf_map(x = district)
mf_map(x = district,
var = "incidence",
type = "choro",
pal = "Reds 3",
var = c("T_POP", "incidence"),
type = "prop_choro",
pal = "Reds",
inches = .1,
breaks = exp(mf_get_breaks(log(district$incidence+1), breaks = "pretty"))-1,
leg_title = "Incidence \n(per 100 000)")
leg_title = c("Population", "Incidence \n(per 100 000)"))
mf_layout(title = "Incidence of W Fever")
# Plot SIRs
# create breaks and associated color palette
break_SIR <- c(0,exp(mf_get_breaks(log(district$SIR), nbreaks = 8, breaks = "pretty")))
col_pal <- c("#273871", "#3267AD", "#6496C8", "#9BBFDD", "#CDE3F0", "#FFCEBC", "#FF967E", "#F64D41", "#B90E36")
mf_map(x = district)
mf_map(x = district,
var = "SIR",
type = "choro",
breaks = break_SIR,
var = c("T_POP", "SIR"),
type = "prop_choro",
breaks = break_SIR,
pal = col_pal,
cex = 2,
leg_title = "SIR")
inches = .1,
#cex = 2,
leg_title = c("Population", "SIR"))
mf_layout(title = "Standardized Incidence Ratio of W Fever")
```
......@@ -155,8 +159,11 @@ m_cases <- mean(district$incidence)
sd_cases <- sd(district$incidence)
hist(district$incidence, probability = TRUE, ylim = c(0, 0.4), xlim = c(-5, 16), xlab = "Number of cases", ylab = "Probability", main = "Histogram of observed incidence compared\nto Normal and Poisson distributions")
curve(dnorm(x, m_cases, sd_cases),col = "blue", lwd = 1, add = TRUE)
points(0:max(district$incidence), dpois(0:max(district$incidence), m_cases),type = 'b', pch = 20, col = "red", ylim = c(0, 0.6), lty = 2)
points(0:max(district$incidence), dpois(0:max(district$incidence),m_cases),
type = 'b', pch = 20, col = "red", ylim = c(0, 0.6), lty = 2)
legend("topright", legend = c("Normal distribution", "Poisson distribution", "Observed distribution"), col = c("blue", "red", "black"),pch = c(NA, 20, NA), lty = c(1, 2, 1))
```
......
No preview for this file type
This diff is collapsed.
public/07-basic_statistics_files/figure-html/LocalMoransI_plt-1.png

43.3 KiB | W: | H:

public/07-basic_statistics_files/figure-html/LocalMoransI_plt-1.png

43.3 KiB | W: | H:

public/07-basic_statistics_files/figure-html/LocalMoransI_plt-1.png
public/07-basic_statistics_files/figure-html/LocalMoransI_plt-1.png
public/07-basic_statistics_files/figure-html/LocalMoransI_plt-1.png
public/07-basic_statistics_files/figure-html/LocalMoransI_plt-1.png
  • 2-up
  • Swipe
  • Onion skin
public/07-basic_statistics_files/figure-html/MoransI-1.png

17.2 KiB | W: | H:

public/07-basic_statistics_files/figure-html/MoransI-1.png

16.8 KiB | W: | H:

public/07-basic_statistics_files/figure-html/MoransI-1.png
public/07-basic_statistics_files/figure-html/MoransI-1.png
public/07-basic_statistics_files/figure-html/MoransI-1.png
public/07-basic_statistics_files/figure-html/MoransI-1.png
  • 2-up
  • Swipe
  • Onion skin
public/07-basic_statistics_files/figure-html/district_aggregate-1.png

45 KiB

public/07-basic_statistics_files/figure-html/inc_visualization-1.png

52.2 KiB | W: | H:

public/07-basic_statistics_files/figure-html/inc_visualization-1.png

80.5 KiB | W: | H:

public/07-basic_statistics_files/figure-html/inc_visualization-1.png
public/07-basic_statistics_files/figure-html/inc_visualization-1.png
public/07-basic_statistics_files/figure-html/inc_visualization-1.png
public/07-basic_statistics_files/figure-html/inc_visualization-1.png
  • 2-up
  • Swipe
  • Onion skin
public/07-basic_statistics_files/figure-html/kd_test-1.png

15.8 KiB | W: | H:

public/07-basic_statistics_files/figure-html/kd_test-1.png

15.4 KiB | W: | H:

public/07-basic_statistics_files/figure-html/kd_test-1.png
public/07-basic_statistics_files/figure-html/kd_test-1.png
public/07-basic_statistics_files/figure-html/kd_test-1.png
public/07-basic_statistics_files/figure-html/kd_test-1.png
  • 2-up
  • Swipe
  • Onion skin
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment