Here we follow the previous section but implement regression analysis using R code from MITOPENCOURSEWARE. We set the code up in a Google Colab and we demonstrate how to load data into R notebook. Colabs are useful for prototyping and sharing projects. The price and quality can vary from year to year for Bordeaux wines very substantially. This is true even though wine producing techniques do not change from year to year. Bordeaux wines are generally understood to improve with age. Hence young wines are often stored until they are mature. The key economic problem then is to predict the price and quality of the wine and traditionally this is accomplished by relying on tasting it in its' youth. The taste will change, of course, substantially by the time it will actually be served. This ostensibly is why wine tasters and experts are so useful. They taste the wines and then forecast which will will achieve the best quality and accordingly price.
Here we will apply some data analytics to answer the same question. We follow the approach suggested by Orley Ashenfelter in predicting the quality of Bordeaux wine without tasting. Ashenfelter's predictions disavow any commentary related to the aroma of the wine and disregards the characteristic marketing nomenclature citrusy, oaky, or nutty. His perspectives are drawn from a few simple variables that can be incorporated into simple linear regression. This basic modelling can be tuned to predicts an outcome variable or dependent variable. And in doing so, it uses a set of what is called independent variables. We do this in the colab below, following R code from MITOPENCOURSEWARE
The dependent variable, Ashenfelter set out is the price of Bordeaux wine achieved in London at auction in 1990-1991. This is a useful proxy for quality. The independent variables include, age of the wine-- so the older wines are more expensive-- and weather-related information, specifically the average growing season temperature, the harvest rain, and winter rain. The data sets here are tiny and we show how to load into google colab directly.