read_tsv (“tab-separated values”), like read_csv.ais.txt:Depends on number and type of variables:
| Categorical | Quantitative | Graph |
|---|---|---|
| 1 | 0 | bar chart |
| 0 | 1 | histogram |
| 2 | 0 | grouped bar charts |
| 1 | 1 | side-by-side boxplots |
| 0 | 2 | scatterplot |
| 2 | 1 | grouped boxplots |
| 1 | 2 | scatterplot with colour |
With more (categorical) variables, might want separate plots by groups. These are called facets.
ggplotggplot, that we use for all our graphs.SportSport is x of graphBMI)x of graphbins. Choose it to show distribution shape clearly.Sport and Sexx and other is filly and categorical xy, “explanatory” as xgeom_smooth to add regression lines or smooth trendsyx, other as fillcolour instead of fillfillcolourx and y as for scatterplot, colour for categoriesSport) to make facets.Default uses same scale for each facet. To use different scales for each facet, this:
Sex as “extra” categorical variablesample for this.On a normal quantile plot:
| Low \ High | Too low | Too high |
|---|---|---|
| Too low | Skewed left | Long tails |
| Too high | Short tails | Skewed right |
Comments