Calculate the residuals using the following info: number of people:12,14,15,18,20,16,14,13,18,19,20,22 and

cost of drinks:24,30,36,38,65,44,36,30,39,76,80,85

To calculate the residuals, we need to perform a regression analysis to determine the relationship between the number of people and the cost of drinks. Specifically, we'll calculate the regression line equation and use it to estimate the expected cost of drinks, given the number of people. Then, the residuals are the differences between the actual cost of drinks and the expected cost of drinks.

Here's how you can do it step by step:

Step 1: Organize the data

Number of people (x): 12, 14, 15, 18, 20, 16, 14, 13, 18, 19, 20, 22
Cost of drinks (y): 24, 30, 36, 38, 65, 44, 36, 30, 39, 76, 80, 85

Step 2: Calculate the regression line equation

First, calculate the mean of x (number of people) and y (cost of drinks):

Mean of x (x̅): (12 + 14 + 15 + 18 + 20 + 16 + 14 + 13 + 18 + 19 + 20 + 22) / 12 = 17
Mean of y (y̅): (24 + 30 + 36 + 38 + 65 + 44 + 36 + 30 + 39 + 76 + 80 + 85) / 12 = 48.5

Next, calculate the sample standard deviation of x (sx) and y (sy):

sx = √((Σ(x - x̅)^2) / (n - 1))
sy = √((Σ(y - y̅)^2) / (n - 1))

Σ(x - x̅)^2 represents the sum of all the squared differences between each x value and the mean of x.
Σ(y - y̅)^2 represents the sum of all the squared differences between each y value and the mean of y.
n represents the number of data points, which in this case is 12.

After calculating sx and sy, you can substitute them into the regression line equation:

y = a + bx

Where a is the y-intercept and b is the slope. The regression line equation can be calculated as follows:

b = Σ((x - x̅)(y - y̅)) / Σ(x - x̅)^2
a = y̅ - b * x̅

Step 3: Calculate the expected cost of drinks using the regression line equation

Use the regression line equation to estimate the expected cost of drinks for each number of people:

Expected cost of drinks (ŷ) = a + b * x

Step 4: Calculate the residuals

Finally, subtract the expected cost of drinks from the actual cost of drinks to find the residuals:

Residual = y - ŷ

By following these steps, you should be able to calculate the residuals given the provided data.