
---
title: "Skew in Quantile-Quantile Plots"
output:
  html_document:
    df_print: paged
    toc: yes
editor_options:
  chunk_output_type: inline
---

Load libraries
```{r, message = F}
library(tidyverse)
theme_set(theme_classic(base_size = 16))
```

Draw samples from the Beta distribution to create four types of distributions

```{r make-distributions}

right_skewed <- tibble(sample = 1:1000,
                           value = rbeta(1000, 1, 10),
                           type = "right skewed")

left_skewed <- tibble(sample = 1:1000,
                          value = rbeta(1000, 10, 1),
                          type = "left_skewed")

symmetric <- tibble(sample = 1:1000,
                        value = rbeta(1000, 10, 10),
                        type = "symmetric")

uniform <- tibble(sample = 1:1000,
                      value = rbeta(1000, 1, 1),
                      type = "uniform")


distributions <- bind_rows(right_skewed, left_skewed, symmetric, uniform)
```

Let's loom at their shapes
```{r histograms, fig.width=10, fig.height=4}
ggplot(distributions, aes(x = value, fill = type)) + 
  facet_grid(~type) + 
  geom_histogram() + 
  theme(legend.position = "none")
```

Now let's look at qq plots
```{r qq-plots, fig.width=10, fig.height=4}
ggplot(distributions, aes(sample = value, fill = type)) + 
  facet_grid(~type, scales = "free") + 
  geom_qq() + 
  geom_qq_line()
  theme(legend.position = "none")
```
