# Linear Regression Formula

Linear regression is a basic and commonly used type of predictive analysis in statistics.  Its complete idea is to examine two things. First, to check whether a set of predictor variables do a good job in predicting an outcome. And second, to find which variable, in particular, is significant predictors of the outcome variable, and in what way.  These regression estimates are very useful for explaining the relationship between one or more independent variables & only one dependent variable.  The simplest form is the linear equation. In this article, we will discuss the linear regression formula with examples. Let us begin the topic!

## Linear Regression Formula

### What is Linear Regression?

It is very important and used for easy analysis of the dependency of two variables. One variable will be considered to be an explanatory variable, while others will be considered to be a dependent variable. Linear regression is a linear method for modeling the relationship between the independent variables and dependent variables. The linearity of the learned relationship makes the interpretation very easy. Linear regression models have long been used by people as statisticians, computer scientists, etc. who tackle quantitative problems. For example, a statistician might want to relate the weights of individuals to their heights using a linear regression model. ### Types of Linear Regression Analyses

• Simple linear regression: It has one dependent variable i.e. interval or ratio. And, one independent variable i.e. interval or ratio.
• Multiple linear regression: It has one dependent variable i.e. interval or ratio. And two or more independent variables i.e. interval or ratio.
• Logistic regression: It has one dependent variable (binary). And two or more independent variable(s) such as interval or ratio.
• Ordinal regression: It has one dependent variable (ordinal) and one or more independent variable(s) which are nominal.
• Multinomial regression: It has one dependent variable i.e. nominal. And, one or more independent variable(s) i.e. interval or ratio.
• Discriminant analysis: It has one dependent variable (nominal). And one or more independent variable(s) i.e. interval or ratio.

### Linear Regression Formula Analyses

The equation is given by:

y=a+bx

a and b can be computed by the following formulas:

b =$$\frac{n\sum xy-\left(\sum x\right)\left(\sum y\right)}{n\sum x^{2}-\left(\sum x\right)^{2}}\\$$

a = $$\frac{\sum y-b \left (\sum x \right )}{n}$$

Where,

x and y are the variables for which we will make regression line.

• b =  Slope of the line.
• a =  Y-intercept of the line.
• X  = Values of the first data set.
• Y = Values of the second data set.

## Solved Examples

Q.1: Find out the linear regression equation for the following sets of data:

 X 2 3 5 8 Y 3 6 5 12

Solution:

 X Y X^2 XY 2 3 4 6 3 6 9 18 5 5 25 25 8 12 64 96 $$\sum X=$$18 $$\sum Y= 26$$ $$\sum X^2 = 102$$ $$\sum XY= 145$$

Now we will apply the formula to get values of a and b, as follows:

$$b =\frac{n\sum xy-\left(\sum x\right)\left(\sum y\right)}{n\sum x^{2}-\left(\sum x\right)^{2}}\\$$

$$b= \frac{4 \times 145 – 18 \times 26}{4 \times 102 – 324}\\$$

$$b = \frac{112}{84}\\$$

b = 1.33

$$a = \frac{\sum y-b \left (\sum x \right )}{n} \\ = \frac{26 -1.33 \times 18}{4}\\$$

a = 0.515

Linear regression equation is given by:

y = 0.515 + 1.33x

Share with friends
Customize your course in 30 seconds

Which class are you in?

5th
6th
7th
8th
9th
10th
11th
12th
Get ready for all-new Live Classes!
Now learn Live with India's best teachers. Join courses with the best schedule and enjoy fun and interactive classes. Ashhar Firdausi
IIT Roorkee
Biology Dr. Nazma Shaik
VTU
Chemistry Gaurav Tiwari
APJAKTU
Physics
Get Started
Customize your course in 30 seconds

Which class are you in?

No thanks.
{"ft_lang_label":"__label__en","ft_lang_prob":0.80275804,"math_prob":0.99822545,"size":3360,"snap":"2022-40-2023-06","text_gpt3_token_len":897,"char_repetition_ratio":0.18563767,"word_repetition_ratio":0.08287293,"special_character_ratio":0.2857143,"punctuation_ratio":0.11951589,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.99993443,"pos_list":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16],"im_url_duplicate_count":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2023-02-07T08:39:27Z\",\"WARC-Record-ID\":\"<urn:uuid:6b061b38-1dd7-45bc-8241-1b36de4c3abc>\",\"Content-Length\":\"104779\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:c07a7ca7-45aa-40cb-99ca-81468bc63bdd>\",\"WARC-Concurrent-To\":\"<urn:uuid:09708561-42d2-4ca9-89ec-fc8e0cbc438d>\",\"WARC-IP-Address\":\"104.20.84.29\",\"WARC-Target-URI\":\"https://www.toppr.com/guides/maths-formulas/linear-regression-formula/\",\"WARC-Payload-Digest\":\"sha1:OTVAHGL3EVJTJBSHEMS3LIYTJR44YR4X\",\"WARC-Block-Digest\":\"sha1:WGV2TXQQ6FKRLTAJGJ4QRQLXBLHF5YU6\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2023/CC-MAIN-2023-06/CC-MAIN-2023-06_segments_1674764500392.45_warc_CC-MAIN-20230207071302-20230207101302-00641.warc.gz\"}"}