Chapter 12 Summary diagnostics in R
Finally, the inbuilt functions “head” and “summary” in R are useful starting points for investigating a variable of interest. Below, I’ve illustrated this with the biscuit dataset.
12.0.1 Taking a “snapshot” of the dataset
That is, subsetting only the data before the policy.
head(before)
## Avg.choc.chips timeframe
## 1 7.479294 2017 - before no eating policy
## 2 9.480802 2017 - before no eating policy
## 3 12.694557 2017 - before no eating policy
## 4 10.569705 2017 - before no eating policy
## 5 10.508374 2017 - before no eating policy
## 6 7.865125 2017 - before no eating policy