Then find the sum of the corresponding products of X and Y: 3*2.5+4*3+5*4+6*4.5=66.5, x_*y_=63/4,
Then calculate the sum of squares of x: 9+ 16+25+36=86, x _ 2 = 8 1/4,
Now we can calculate that b: b = (66.5-4 * 63/4)/(86-4 * 81/4) = 0.7.
And a=y_-bx_=7/2-0.7*9/2=0.35,
So the regression linear equation is y=bx+a=0.7x+0.35.
Extended data:
Operation of regression equation:
If there is a set of data (X and Y) of related variables, we can observe that all data points are distributed near a straight line through the scatter plot, and we can draw many such straight lines. We hope that one of them can best reflect the relationship between X and Y, that is, we should find a straight line to make it "closest" to the known data points.
Because there are residuals in the model, which cannot be eliminated, it is impossible to determine a straight line with two points to get the equation. In order to ensure that almost all the measured values converge on a regression line, we need the minimum distance from the sum of the squares of their longitudinal distances to the best fitting line. ?
Let's write this linear equation (as shown on the right, written as formula ①). Here, the mark ""is added above Y to distinguish the actual value Y of Y, which means that when X takes the value xi = 1, 2 ..., 6), the observed value corresponding to Y is yi, and the ordinate corresponding to Xi on the straight line is formula ①, which is called Y to X.
Regression straight line equation, the corresponding straight line is called regression straight line, and b is called regression coefficient. To determine the regression linear equation ①, only a and regression coefficient b need to be determined.
Relevant quantities of regression equation: e. random variable B. slope A. mathematical expectation of intercept-X. mathematical expectation of X-Y. accuracy of regression equation.
Solution of regression straight line
Least square method:
The total deviation cannot be the sum of n deviations.
It is usually the sum of squares of deviations, that is, as the total deviation, and it is minimized so that the regression straight line is the one with the smallest q value among all straight lines. This method of minimizing the sum of squares of deviations is called the least square method:
References:
Baidu encyclopedia-regression equation