2024-03-18

Showing the data

head(storms)
## # A tibble: 6 × 13
##   name   year month   day  hour   lat  long status       category  wind pressure
##   <chr> <dbl> <dbl> <int> <dbl> <dbl> <dbl> <fct>           <dbl> <int>    <int>
## 1 Amy    1975     6    27     0  27.5 -79   tropical de…       NA    25     1013
## 2 Amy    1975     6    27     6  28.5 -79   tropical de…       NA    25     1013
## 3 Amy    1975     6    27    12  29.5 -79   tropical de…       NA    25     1013
## 4 Amy    1975     6    27    18  30.5 -79   tropical de…       NA    25     1013
## 5 Amy    1975     6    28     0  31.5 -78.8 tropical de…       NA    25     1012
## 6 Amy    1975     6    28     6  32.4 -78.7 tropical de…       NA    25     1012
## # ℹ 2 more variables: tropicalstorm_force_diameter <int>,
## #   hurricane_force_diameter <int>
head(storms_by_name_year)
## # A tibble: 6 × 5
## # Groups:   name [6]
##   name      year avgLat avgLong avgWind
##   <chr>    <dbl>  <dbl>   <dbl>   <dbl>
## 1 AL011993  1993   25.7   -75.2    29.5
## 2 AL012000  2000   20.8   -93.1    25  
## 3 AL021992  1992   26.7   -84.5    29  
## 4 AL021994  1994   33.6   -79.7    24.2
## 5 AL021999  1999   20.4   -96.4    28.8
## 6 AL022000  2000    9.9   -28.5    29.2
head(storms_by_category)
## # A tibble: 6 × 2
##   category avgWind
##      <dbl>   <dbl>
## 1        1    71.0
## 2        2    89.5
## 3        3   104. 
## 4        4   122. 
## 5        5   146. 
## 6        0    38.1

3D Plotly Plot

GGPlot 1: Longitude and Latitude of each Storm

Simple Linear Regression on Longitude and Latitude

model: \(\text{Volume} = \beta_0+\beta_1\cdot\text{Longitude} + \varepsilon; \hspace{1 cm} \varepsilon \sim N(0; \sigma^2)\)
  fitted: \(\text{Volume} = \hat{\beta}_0 + \hat{\beta}_1 \cdot \text{Longitude}\)          \(\hat{\beta}_0 = b_0 - \text{estimate of}\beta_0\); \(\hat{\beta}_1 = b_1 - \text{estimate of}\beta_1\)

GGPlot 2: Storm Category vs Average Wind Speed

Simple Linear Regression on Category vs Average Wind Speed

model: \(\text{Volume} = \beta_0+\beta_1\cdot\text{Category} + \varepsilon; \hspace{1 cm} \varepsilon \sim N(0; \sigma^2)\)
  fitted: \(\text{Volume} = \hat{\beta}_0 + \hat{\beta}_1 \cdot \text{Category}\)          \(\hat{\beta}_0 = b_0 - \text{estimate of}\beta_0\); \(\hat{\beta}_1 = b_1 - \text{estimate of}\beta_1\)

Last fun one: Average wind speeds of storms based on the first letter of their names

storms_letter = storms %>%
  group_by(name) %>%
  summarise(avgWind = mean(wind))

storms_letter$first = substr(
  storms_letter$name, start = 1, stop = 1)

# All unnamed storms start with "AL"
storms_letter = storms_letter %>%
  mutate(first = replace(first, substr(
    name, start = 1, stop = 2) == "AL", "#"))

ggplot(storms_letter, aes(first,avgWind, fill = factor(first))) +
  geom_boxplot() +
  ggtitle("Average wind speeds for the starting letter of each storm") +
  xlab("First Letter of Name") +
  ylab("Average Wind Speed (Knots)") +
  theme(legend.position = "none")

#NOTED we are missing Q, U, X, Y, and only have one Z (Zeta)

# # is for unnamed storms, normally meaning that they were 
# classified as storms later on, so they are very small on average