About the Data:
The Beer Profile and Ratings dataset from Kaggle was used for the project. The main data set (beer_profile_and_ratings.csv) contains the following columns: (General) • Name: Beer name (label) • Style: Beer Style • Brewery: Brewery name • Beer Name: Complete beer name (Brewery + Brew Name) • Description: Notes on the beer if available • ABV: Alcohol content of beer (% by volume) • Min IBU: The minimum IBU value each beer can possess • Max IBU: The maximum IBU value each beer can possess
(Mouth feel) • Astringency • Body • Alcohol (Taste) • Bitter • Sweet •Sour • Salty (Flavor And Aroma) • Fruits • Hoppy • Spices • Malty
(Reviews) • review_aroma • review_appearance • review_palate •review_taste • review_overall • number_of_reviews
library(tidyverse)
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr 1.1.2 ✔ readr 2.1.4
## ✔ forcats 1.0.0 ✔ stringr 1.5.0
## ✔ ggplot2 3.4.3 ✔ tibble 3.2.1
## ✔ lubridate 1.9.2 ✔ tidyr 1.3.0
## ✔ purrr 1.0.2
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag() masks stats::lag()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(ggplot2)
library(reshape2)
##
## Attaching package: 'reshape2'
##
## The following object is masked from 'package:tidyr':
##
## smiths
library(dplyr)
library(gridExtra)
##
## Attaching package: 'gridExtra'
##
## The following object is masked from 'package:dplyr':
##
## combine
library(boot)
library(pwr)
# Loading the dataset in beers data frame
beers <- read.csv("/Users/bhavyakalra/Desktop/Stats R/Final_project_beer/beer_profile_and_ratings.csv")
head(beers)
## Name Style
## 1 Amber Altbier
## 2 Double Bag Altbier
## 3 Long Trail Ale Altbier
## 4 Doppelsticke Altbier
## 5 Sleigh'r Dark Doüble Alt Ale Altbier
## 6 Sticke Altbier
## Brewery
## 1 Alaskan Brewing Co.
## 2 Long Trail Brewing Co.
## 3 Long Trail Brewing Co.
## 4 Uerige Obergärige Hausbrauerei GmbH / Zum Uerige
## 5 Ninkasi Brewing Company
## 6 Uerige Obergärige Hausbrauerei GmbH / Zum Uerige
## Beer.Name..Full.
## 1 Alaskan Brewing Co. Alaskan Amber
## 2 Long Trail Brewing Co. Double Bag
## 3 Long Trail Brewing Co. Long Trail Ale
## 4 Uerige Obergärige Hausbrauerei GmbH / Zum Uerige Uerige Doppelsticke
## 5 Ninkasi Brewing Company Sleigh'r Dark Doüble Alt Ale
## 6 Uerige Obergärige Hausbrauerei GmbH / Zum Uerige Uerige Sticke
## Description
## 1 Notes:Richly malty and long on the palate, with just enough hop backing to make this beautiful amber colored "alt" style beer notably well balanced.\\t
## 2 Notes:This malty, full-bodied double alt is also known as “Stickebier” – German slang for “secret brew”. Long Trail Double Bag was originally offered only in our brewery taproom as a special treat to our visitors. With an alcohol content of 7.2%, please indulge in moderation. The Long Trail Brewing Company is proud to have Double Bag named Malt Advocate’s “Beer of the Year” in 2001. Malt Advocate is a national magazine devoted to “expanding the boundaries of fine drinks”. Their panel of judges likes to keep things simple, and therefore of thousands of eligible competitors they award only two categories: “Imported” and “Domestic”. It is a great honor to receive this recognition.33 IBU\\t
## 3 Notes:Long Trail Ale is a full-bodied amber ale modeled after the “Alt-biers” of Düsseldorf, Germany. Our top fermenting yeast and cold finishing temperature result in a complex, yet clean, full flavor. Originally introduced in November of 1989, Long Trail Ale beer quickly became, and remains, the largest selling craft-brew in Vermont. It is a multiple medal winner at the Great American Beer Festival.25 IBU\\t
## 4 Notes:
## 5 Notes:Called 'Dark Double Alt' on the label.Seize the season with Sleigh'r. Layers of deeply toasted malt are balanced by just enough hop bitterness to make it deceivingly drinkable. Paired with a dry finish, Sleigh’r is anything but your typical winter brew.An Alt ferments with Ale yeast at colder lagering temperatures. This effect gives Alts a more refined, crisp lager-like flavor than traditional ales. The Alt has been “Ninkasified” raising the ABV and IBUs. Sleigh'r has a deep, toasted malt flavor that finishes dry and balanced.50 IBU\\t
## 6 Notes:
## ABV Min.IBU Max.IBU Astringency Body Alcohol Bitter Sweet Sour Salty Fruits
## 1 5.3 25 50 13 32 9 47 74 33 0 33
## 2 7.2 25 50 12 57 18 33 55 16 0 24
## 3 5.0 25 50 14 37 6 42 43 11 0 10
## 4 8.5 25 50 13 55 31 47 101 18 1 49
## 5 7.2 25 50 25 51 26 44 45 9 1 11
## 6 6.0 25 50 22 45 13 46 62 25 1 34
## Hoppy Spices Malty review_aroma review_appearance review_palate review_taste
## 1 57 8 111 3.498994 3.636821 3.556338 3.643863
## 2 35 12 84 3.798337 3.846154 3.904366 4.024948
## 3 54 4 62 3.409814 3.667109 3.600796 3.631300
## 4 40 16 119 4.148098 4.033967 4.150815 4.205163
## 5 51 20 95 3.625000 3.973958 3.734375 3.765625
## 6 60 4 103 4.007937 4.007937 4.087302 4.192063
## review_overall number_of_reviews
## 1 3.847082 497
## 2 4.034304 481
## 3 3.830239 377
## 4 4.005435 368
## 5 3.817708 96
## 6 4.230159 315
# Performing Chi squared test
contingency_table <- table(beers$Style, beers$Brewery)
chi_squared_result <- chisq.test(contingency_table, correct = TRUE)
## Warning in chisq.test(contingency_table, correct = TRUE): Chi-squared
## approximation may be incorrect
print(chi_squared_result)
##
## Pearson's Chi-squared test
##
## data: contingency_table
## X-squared = 127134, df = 102630, p-value < 2.2e-16