# Challenge: Regression Analysis

Assess your skills by completing a challenge.

We'll cover the following

## Explained sum of squares

The explained sum of squares (ESS), also known as the explained variation, is the portion of total variation that measures how well the regression equation explains the relationship between $X$ and $Y$.

## Residual sum of squares

The residual sum of squares (RSS), also known as unexplained variation, is the portion of total variation that measures discrepancies (errors) between the actual values of $Y$ and those estimated by the regression equation.

## Problem statement

You are given a piece of R code for calculating the TSS, ESS, and RSS. The task is to compute the TSS, ESS, and RSS by using the given dataset (final.85) and model (model1).

### Formulas

1. Total variations in $y$, that is., total sum of squares (TSS).

$\Sigma_{i=1}^{n}(y_i - \bar y)^2$

It means the sum of squared deviations of actual $y$ from mean of $y$ ($\bar y$ ) across observations.

1. Explained variations in $y$, that is, explained sum of squares (ESS).

$\Sigma_{i=1}^n(\hat{y_i}-\bar{y})^2$

It means the sum of squared deviations of predicted $\hat y$ from mean $\bar y$ across observations.

1. Unexplained variations in $y$, that is, residual sum of squares (RSS).

$\Sigma_{i=1}^n(y_i-\hat{y})^2$

Get hands-on with 1200+ tech skills courses.