185. Simple Linear Regression

Example

Data

(Hours Studied) (Test Score)
1 2
2 3
3 5
4 4
5 6

Step 1: Calculate Means

Step 2: Calculating Slope

  • The numerator
  • The denominator
  • The slope is

Step 3: Calculate Intercept

Step 4: Calculate p-Value

  • Calculate Standard Error of the Slope ()
  • Calculate the Residual Sum of Squares (RSS)
  • Calculate the t-statistic for the Slope
  • Determine Degrees of Freedom
  • Look up the p-value corresponding to with 3 degrees of freedom

Step 5: Calculate ()

(Regression Sum of Squares): sum of the squared differences between the predicted values and the mean of the observed values.

(Total Sum of Squares): sum of the squared differences between the observed values and the mean of the observed values.

Adjusting for the number of independent variables

  • : number of observations
  • : number of independent variables