How can you calculate Linear Regression? Linear Regression

How can you calculate Linear Regression?

SHARE THE ARTICLE ON

Table of Contents

Linear Regression is a form of statistical approach, allegedly invented by Carl Friedrich Gauss. However, it was first published by Adrien-Marie Legendre in a scientific paper. 

A Linear Regression is useful to examine and establish a relationship between the two separate variables – independent or explanatory and dependent or response variables. 

Linear Regression further breaks down into two categories –

# Simple Linear Regression: The model includes one independent variable

# Multiple Linear Regression: This model includes more than one independent variable

Linear Regression is used in various industries. In general, its applications fall into two categories: 

The model can be used as a predictive model when the goal of the analyst is prediction or error reduction. 

It can be applied when you want to understand the strength of the relationship between the independent and dependent variables. It helps to determine whether the variables have any relationship or not. Additionally, it is used to identify the subset of the independent variable that has an influence on the dependent variable.

Transform your insight generation process

Create an actionable feedback collection process.

online survey

Calculating the Linear Regression

Linear Regression Analysis is a type of Regression Analysis that is used to find an equation that fits the data. 

You can use a Simple Linear Regression when: 

A correlation coefficient can likely predict future outcomes

The data points in the scatter plot form a linear line

The equation is in the form of “Y = a + bX”. You may also recognize it as the slope formula. 

Y = Dependent variable

X = Independent variable

b = Slope of the line

a = y-intercept

To find the linear equation by hand, you need to get the value of “a” and “b”. 

Then substitute the resulting value in the slope formula and that gives you your linear regression equation. 

We will take the following example to understand how it is done. There are a few steps you need to follow to find your correlation coefficient. 

Download Market Research Toolkit

Get market research trends guide, Online Surveys guide, Agile Market Research Guide & 5 Market research Template

Making the most of your B2B market research in 2021 PDF 3 s 1.png

Lets take the dataset as an example:

Month

Money Spent (X)

Avg(X) – X

[Avg(X) – X]^2

Sales (Y)

Avg(Y) – Y 

[Avg(X)-X * Avg(Y)-Y]

1

2000

1500

1,690,000

5000

7600

11,400,000

2

3000

300

90,000

10000

2600

780,000

3

4000

-700

490,000

15000

-2400

1,680,000

4

2500

800

640,000

8000

4600

3,680,000

5

5000

-1700

2,890,000

25000

-12400

21,080,000

AVG(X)

3300

  

12600

  
  

SUM XX

5,800,000

 

SUM YY

37,918,000

Find the average of the 

  • X variable, in this case, it is the Money Spent = 3300
  • Y variable, in this case, it is Sale = 12600

Measure the difference between the Average X and individual X 

Square the difference and add the result: SUM XX = 5, 800,000

Multiple the between Avg(X)-X and Avg(Y)-Y and add the results: SUM XY = 37,918,000

To calculate the Slope of the Line, divide the SUM XY by SUM XX

  • b (Slope of the line) = 37,918,000 / 5,800,000 = 6.53758621

To calculate the y-intercept subtract Avg(Y) from Slope * AVG(X)

  • a (y-intercept) = 12600 – 6.53758621* 3300 = 8,974.0345

So, now you have a SImple Linear Regression

  • Y = a + bX
  • Y = 8,974.0345 + 6.53758621 * X

 

See Voxco survey software in action with a Free demo.

Net Promoter®, NPS®, NPS Prism®, and the NPS-related emoticons are registered trademarks of Bain & Company, Inc., Satmetrix Systems, Inc., and Fred Reichheld. Net Promoter Score℠ and Net Promoter System℠ are service marks of Bain & Company, Inc., Satmetrix Systems, Inc., and Fred Reichheld.

Explore all the survey question types
possible on Voxco

Read more