diff --git a/module3/exo1/influenza-like-illness-analysis.org b/module3/exo1/influenza-like-illness-analysis.org index 5befa77bdd270d1adedc696514f7b8f0a9880cac..180b48b4b8615facfe5f5cc4da702d76442fd41d 100644 --- a/module3/exo1/influenza-like-illness-analysis.org +++ b/module3/exo1/influenza-like-illness-analysis.org @@ -167,6 +167,7 @@ for date1, date2 in zip(dates[:-1], dates[1:]): ** Transfer Python -> R We switch to R for data inspection and analysis, because the code is more concise in R and requires no additional libraries. + Org-mode's data exchange mechanism requires some Python code for transforming the data to the right format. #+NAME: data-for-R @@ -196,8 +197,10 @@ plot(tail(data, 200), type="l", xlab="Date", ylab="Weekly incidence") #+END_SRC * Study of the annual incidence + ** Computation of the annual incidence Since the peaks of the epidemic happen in winter, near the transition between calendar years, we define the reference period for the annual incidence from August 1st of year /N/ to August 1st of year /N+1/. We label this period as year /N+1/ because the peak is always located in year /N+1/. The very low incidence in summer ensures that the arbitrariness of the choice of reference period has no impact on our conclusions. + This R function computes the annual incidence as defined above: #+BEGIN_SRC R :results silent :exports both @@ -241,4 +244,4 @@ Finally, a histogram clearly shows the few very strong epidemics, which affect a #+BEGIN_SRC R :results output graphics :file annual-inc-hist.png :exports both hist(annnual_inc$incidence, breaks=10, xlab="Annual incidence", ylab="Number of observations", main="") -#+END_SRC \ No newline at end of file +#+END_SRC