Day 02 of #66DaysofData challenge

Suppose we have some data of Weight vs Size of people, there are three steps to linear regression.
- 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:
- StatQuest by Josh Stramer
- https://www.rpubs.com/shubh2565/pvalue-rsquared