Linear Regression

Umaiskhan
2 min readOct 1, 2023

Day 02 of #66DaysofData challenge

Suppose we have some data of Weight vs Size of people, there are three steps to linear regression.

  1. Calculate R² value: First we calculate the mean of all sizes, this will shift all the values to y-axis.

Now we measure the distance of all data points from the mean and square them, then add those values together.

Calculate the variation around this data by dividing the sum of squared values by total number of samples.

Now compare both graphs above, this explains that how much variation is caused when we take weight(x-axis) into account. This is the basic idea of R².

2. Calculate p value: p-value tell if R² value that we calculated is significant or not.

3. Prediction: So by knowing R² values and equation of line we can predict if someone has certain weight will have certain size.

References:

  1. StatQuest by Josh Stramer
  2. https://www.rpubs.com/shubh2565/pvalue-rsquared

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Umaiskhan
Umaiskhan

Written by Umaiskhan

Mechanical Engineer with a twist of AI

No responses yet

Write a response