Regression is an elementary concept of statistics that estimates the relationship between a dependent variable and an independent variable. This example will feature cigarette sales to show how regression can be used in economic analysis.
Regression is an elementary concept of statistics that estimates the relationship between a dependent variable and an independent variable. This example will feature cigarette sales to show how regression can be used in economic analysis.
The law of demand in economics states that, all else being equal, demand will decrease as price increases. To illustrate this, data collected in 1985 and 1995 about cigarette prices will be analyzed using regression to identify a correlation between price and sales. Specifically, the variables to be examined are:
ggplot(CigarettesSW, aes(x = year, y = packs)) +
geom_boxplot(fill = "blue", alpha = 0.7) +
labs(
title = "Cigarette Sales per Capita by Year",
x = "Year",
y = "Annual Packs Sold per Capita"
) +
theme_minimal(base_size = 16)
The previous slide showed that there was a decrease in purchases between 1985 and 1995. We will now investigate whether a change in price had something to do with it. How will we find out? \[ Q_i = \beta_0 + \beta_1 P_i + \varepsilon_i \] This is a simple model of regression. It follows the form of a linear equation, with the only addition being the epsilon. The epsilon accounts for possible confounding factors.
Indeed, there is a negative correlation between pack price and sales.
This line is the line of best fit between these two variables.
Ordinary least squares is a technique to choose that regression line. It is as follows: \[ \min_{b_0,b_1} \sum_{i=1}^{n} (Q_i - b_0 - b_1 P_i)^2 \] This minimizes the sum of the squares of the residuals, or the distance from the line to each point. Doing so generates the most fitting line.
One last thing to do is to look at a third variable. This is more of an exercise than plotting than anything because tax (the new variable being plotted) is usually just a function of price. Still, there is variance, and this permits us to see it.
Very cool.
One important thing to note is that a strong correlation does not imply causation. In fact, the collectors of this data made this very point in their findings. Due to the impossibility of ruling out factors such as advertising, policy, supply, and many other things that may have had an effect on sales, we cannot conclusively say that the price increase was the cause of the decline in sales. Further analysis would be required to prove that, which is outside the scope of this presentation. Rest assured, however, that it can be done: for your edification, you may look into difference-in-difference for one such method.
Anyway, that concludes the presentation. Thank you for watching!