Confidence Intervals and Regression

Confidence Intervals

When creating descriptive statistics, estimated numbers are often single values, such as the mean, median, variance, and IQR.

Consider the business question: "Is the Outlier Oven pizza shop selling on average 200 pizzas per day following an incentive scheme?" The sample mean is 204.6.

Instead of calculating the sample mean to estimate the population mean (yˉ\bar{y} to estimate μ\mu), we can calculate an interval ([a,b]\lbrack a, b \rbrack) that we think contains the population mean, where a100,200)a 100, 200 ).

A business has a p% chance to break a profit and (100-p)% chance of making a loss. Each day is independent. If the company went 3 days making a profit before making a loss on the 4th day, we can estimate the value of p.

Larger Interval:

  • More likely to contain the population parameter.

  • Less informative.

Smaller Interval:

  • Less likely to contain the population parameter.

  • More informative.

A confidence interval (CI) is an interval which is expected to contain the population parameter being estimated with a certain level of confidence.

Correlation

In many business questions, we want to see if there is an association between two numeric variables. Correlation is a number between -1 and 1. It can be positive or negative.

EXAMPLES

  • Is there a relationship between the amount of money spent on marketing and the sales revenue generated?

  • Is there a relationship between the number of website visitors and the conversion rate (how many of those visitors make a purchase)?

  • Is there a connection between research and development (R&D) investments and long-term profit growth?

EXPECTATION

  • Is there a relationship between the amount of money spent on marketing and the sales revenue generated? Positive relationship.

  • Is there a relationship between the number of website visitors and the conversion rate (how many of those visitors make a purchase)? No idea.

  • Is there a connection between research and development (R&D) investments and long-term profit growth? Positive relationship.

Calculating Correlation in Excel:

  1. Open the data analysis toolkit

  2. Select the “Correlation” tool from the list.

  3. Select all your numeric data.

  4. Check other boxes if needed.

A correlation coefficient of 1 indicates a perfect positive linear relationship between two numerical variables.

This perfect correlation is represented when a variable is correlated with itself, resulting in a correlation coefficient of 1.

Furthermore, the correlation coefficient is symmetric, meaning the correlation between X and Y is equivalent to the correlation between Y and X. Hence, only one value suffices to represent their correlation.

Correlation does not mean causation.

  1. If a company observes a correlation between coffee consumption and higher employee productivity, it doesn't necessarily mean coffee causes productivity. There could be underlying factors like tight deadlines or high workloads causing both.

  2. A business might find a correlation between implementing training programs and better employee retention. However, company culture or other benefits could be the real reasons employees stay, not necessarily the training itself.

  3. There may be a correlation between the size of a company’s office space and its revenue. The real driver could be company growth, which leads to both larger offices and increased revenue.

Linear Regression

A scatter plot shows the relation between two numerical variables. These two variables, X and Y, are referred to as the predictor and response variable, although they do have other names.

X: predictor, determinant, independent

Y: response, outcome, dependent

Examples of Dependent and Independent Variables:

a. Does the sales of a new product depend on the advertising expenditures?

b. Does the impact of temperature changes affect the crop yields in Australia?

c. Does the number of posts an individual makes impact their total number of followers.

Mathematical Notation:

  • y = location on the y-axis

  • m = slope of the line

  • X = location on the x-axis

  • c = intercept. Value of y when x = 0

Straight Line: y=mx+cy = mx + c

Equation of the regression line: y^=b<em>0+b</em>1x\hat{y} = b<em>0 + b</em>1x

Intercept (b_0b\_0):

  • Value of y when x = 0.

  • Where the line crosses the y axis.

Slope (b_1b\_1):

  • Defines how steep the line is.

  • Which direction the line goes (positive/negative)

The regression line does not get all the y values exactly correct, there is some error. These errors are also known as residuals. (We know these errors are going to happen)

  1. A regression line can help use predict a value of y given a value of x.

  2. A regression model can explain some of the variation in y (higher explained variance is better)

We want to the number of weekly riders based of the population of the city.

Fitting a regression in Excel:

  1. Open the data analysis toolkit

  2. Select the “Regression” tool from the list.

  3. Select the cells of your dependent variable as the Input Y Range.

  4. Select the cells of your independent variable as the Input X Range.

  5. Click the tick box labelled Residuals.

Interpretation:

Change in X Change in Y

Positive b<em>1b<em>1 For every increase of 1 in X Y increases by b</em>1b</em>1 units on average

Negative b<em>1b<em>1 For every increase of 1 in X Y decreases by ∣b</em>1∣\vert b</em>1 \vert units on average

b_0b\_0 ?? ?

The intercept b<em>0b<em>0 is the value of y^\hat{y} when x is 0. Interpretation is data dependent but if you were to regress salary on years in the company, then b</em>0b</em>0 could be considered the entry level salary.

  1. Residuals in a scatter plot represent the vertical distances between data points and the regression line.

  2. Residuals can be positive or negative, depending on whether data points lie above or below the regression line, respectively

Equation of the regression equation: y=β<em>0+β</em>1x+εy = \beta<em>0 + \beta</em>1x + \varepsilon

  • Intercept (β_0\beta\_0)

  • Slope (β_1\beta\_1)

  • Residuals (ε\varepsilon )

Assumptions of a Linear Model:

  1. Linearity of relationship between variables

  2. Independence of the residuals

  3. Normality of the residuals

  4. Equality of variance of the residuals

Assumptions of a Linear Model:

  1. (L) Linearity of relationship between variables

  2. (I) Independence of the residuals

  3. (N) Normality of the residuals

  4. (E) Equality of variance of the residuals