March 2019
Beginner to intermediate
448 pages
13h 14m
English
In this recipe, we have the number of people in a town, and whether they vote for Candidate A or Candidate B – these are flagged by 1s and 0s. We want to study the variability of several sample sizes, and ultimately we want to define which sample size is appropriate. Intuition would suggest that the error decreases nonlinearly as we increase the sample size: when the sample size is small, the error should decrease slowly as we increase the sample size. On the other hand, it should decrease quickly when the sample is large.
library(dplyr)library(ggplot2)
voters_data = read.csv("./voters_.csv")
Read now
Unlock full access