2024-01-21

Exercise 3.3

Apply your favorite transformation from Exercise 3.2 to the data,

  • firstly excluding Brazil and China, and

  • secondly excluding all dates before 2013.

  • Produce a pair of plots similar to those in Exercise 3.2.

  • What conclusions can we draw from our investigations?

  • Does chocolate consumption improve intellectual output (for which Noble prizes might be considered a proxy)?

  • If so, why? If not, what can we conclude?

exclude Brazil and China

class(cnd)
## [1] "data.frame"
cnd_ex <- cnd[!(cnd$country %in% c("Brazil", "China")), ]

exclude all dates before 2013

cnd2013 <- cnd_ex[cnd_ex$year >= 2013, ]

cnd2013
##        country choc_kg year Nobel_no Nobel_10m
## 1      Germany    12.2 2013      105    13.013
## 2  Switzerland    11.7 2014       25    30.125
## 3       Norway     9.6 2013       13    24.947
## 4           UK     8.9 2013      125    19.315
## 5      Austria     8.8 2013       21    24.577
## 6      Denmark     7.6 2013       14    24.695
## 7      Finland     7.2 2013        4     7.268
## 8      Belgium     6.9 2013       10     8.850
## 9       France     6.7 2013       61     9.473
## 10      Sweden     6.2 2013       30    30.677
## 11   Lithuania     5.8 2013        1     3.474
## 12       Italy     3.9 2013       20     3.345
## 13       Czech     3.6 2013        5     4.742
## 14       Spain     3.4 2013        8     1.735
## 15    Portugal     2.9 2013        2     1.932
## 16     Hungary     2.7 2013        9     9.132

plot without any log

log on choc_kg

log on nobel_10m

log on both

Conclusion drawn:

There is a powerful relationship between chocolate consumption and the number of Nobel laureates in various countries.

Does chocolate consumption improve intellectual output?

A correlation between X and Y does not prove causation but indicates that:

  • either X influences Y,

  • Y influences X,

  • or X and Y are influenced by a common underlying mechanism