Thursday, April 9, 2015

Wine Quality Analysis

Have you ever wondered what chemical properties qualify a wine to be a good quality wine? As part of the final project for my certification in 'R', I had to do some Exploratory Data Analysis on a data set which had various chemical properties and the associated quality rating for different types of wines grown in and around Portugal. Let us look at the different properties and their influence on quality in the following study.

The scope of this analysis is to understand the relationship of various chemical properties and their impact on the quality ratings of Red and White wine.

The wine data sample set contains information on 6497 observations of 13 variables. I combined the red wine data which had 1599 observations with white wine data consisting of 4898 observations. I started by analyzing the individual variables in the red and white wine separately,and then I combined them and explored interesting questions and leads as I continued to make observations on plots.



The pH of wine is an important factor which determines the quality of the wine in terms of taste, color, oxidation and chemical stability.  Most wines optimally have a pH between 2.9 and 4.0 Lower pH values allow the wine to stay fresher for a longer period and retain its original color and flavor. 




From the analysis of the plot above ,we can see that, as the quality of the wine goes up, the pH stays at around 3.5. Medium quality wines seem to have a slightly higher pH compared to the fine quality wines.


Alcohol has a negative correlation with density. As the alcohol content increases, the density decreases. This is true for both red and white wine samples.

The plot below indicates that white wine does exhibit higher SO2 components as compared to Red Wine across all pH values within the sample.There seems to be higher variation for both SO2 values in both red and white wines between a pH value of 3.5 and 4.0.



Red wine has less residual sugar and less SO2 compared to white wine.








Interesting observation is as the acidity goes up, the pH comes down. Also, acidity seems to be higher for red wine sample compared to the white wine sample.





Wine makers add the extra SO2 to white wine to prevent oxidation. Red wines have natural anti-oxidant. White wines lack this anti-oxidant and wine makers add SO2 to prevent the oxidation.The analysis proves that White wine exhibits a higher level of SO2 properties compared to red wine for the same pH.


Reflection

The pH of wine is an important factor which determines the quality of the wine in terms of taste, color, oxidation and chemical stability. The general rule for pH in wine making is the higher the pH reading, the lower amount of acidity in the wine. Most wines optimally have a pH between 2.9 and 4.0, with different values based on the type of wine. Any pH above 4.0 indicates that the wine will spoil quickly and be chemically unstable. Lower pH values allow the wine to stay fresher for a longer period and retain its original color and flavor. The pH can also impact the amount of free sulfur dioxide (SO2) present. The free SO2 helps in breaking down bacteria and prevent spoiling.

For the final analysis, I chose the effect of pH on acidity,free SO2 and Quality.

Some of the learnings from the analysis were as follows:
  1. pH value is a key factor in determining the quality of the wines and from the analysis, we found that higher quality wines had a low pH and high fixed acidity. From the samples analyzed,the wines with lower pH had higher acidity content. The acidity went down as the pH level increased. Red wines have more acidity and lower pH compared to white wines.
  2. Wine makers add the extra SO2 to white wine to prevent oxidation.Red wines have natural anti-oxidant. White wines lack this anti-oxidant and wine makers add SO2 to prevent the oxidation.The analysis proves that White wine exhibits a higher level of SO2 properties compared to red wine for the same pH. SO2 can cause allergic reactions in some people. It is dangerous for asthmatics even at very low levels. So, now that we know that white wine has more SO2 than red, it is better to avoid white wine, if one is asthmatic.
  3. High pH values for a wine will affect its quality. Lower pH values will make the wine taste tart and crisp. Our analysis proves this factor. As the quality goes up, the pH remains at around 3.5. Medium quality wines seem to have a slightly higher pH compared to the fine quality wines. For the white wine sample with a quality value of 9, the pH remained less than 3.5
  A limitation of the current analysis is that the data consists of samples collected from a specific region in Portugal. It will be interesting to compare wines grown in other regions with the current data set and current analysis. It would be intriguing to see the effect of climate on the quality of wine.