We are going to use a new type of graph to do this, it’s called a bar plot.
For this we use
As well as the bar plot, we can also use the
Sickness summarises all of the symptoms. Now it’s time to get specific!
Can you make some other bar plots to see what the students were sick with?
- Remember we can use
colnames(outbreak_data)to find out what information we have in
- You might also like to try customising your plot.
- Remember we can change the colour by specifying
fill =within the
geom_bar()command. You might also like to try
aes(fill = ).
What have you found? What symptoms are the most common ?
Data can be formatted in different ways. For example, prioritise having one row per individual with lots of columns. This is like our
Or sometimes we can change the format and so instead we have a long list of one observation per row. This is what we have in our
For the next few plots we are going to use
symptoms and not
outbreak_data, however they record exactly the same thing
This doesn’t necessarily help us to decide what is making the students sick because they are not separated as to whether they were sick or not. We really want to separate those that have a YES in
This needs the
What does this graph tell us?
What are the symptoms of those that are sick?
What might be some causes of illness that give these symptoms?
Likely cause is … Salmonella
What is salmonella?
A bacterial infection
Commonly from contaminated food
Examples…undercooked chicken, raw egg, incomplete cleaning
You can start to feel sick within 6 to 36 hours after eating
Examples in the media
But how did the students get sick ?