| infection | R Documentation | 
This data set contains information on gender, weight, and age of individuals with and without a parasite infection.
infection
A data frame with 81 observations (rows) and 4 variables (columns).
| Column name | Data type | Description | Values | |
| [,1] | infected | integer | Parasite infection, 1 if infected, otherwise 0 | (0, 1) | 
| [,2] | age | integer | The age of the individual | (1 - 206) | 
| [,3] | weight | integer | The weight of the individual | (1 - 18) | 
| [,4] | sex | factor | The gender | (female male) | 
infected is the binary response variable, and age, weight
(both continuous) and sex (categorical) are explanatory variables.
The R book, M.J. Crawley, Wiley, 2013.
# The relationship between infection and gender
table(infection$infected, infection$sex)
# Get two boxplots next to each other
par(mfrow = c(1, 2))
boxplot(weight ~ infected, data = infection, col = "lightgreen")
boxplot(age ~ infected, data = infection, col = "lightgreen")
# Reset to default settings
par(mfrow = c(1, 1))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.