Linear regression exercise-the relationship between the height of parents and children
Excel basic settings
The Excel used below is the one that comes with win10
Select "File", click "Options", select "Add-ons", click "Go" to check the two items in the figure below
Ways to generate regression fitting graphs
Click "Data", select "Data Analysis", select "Regression" in the analysis tool and click "Confirm"
in the subsequent interface to select the entered x and y values (click the arrow after the box to see the quick tick), and then tick Choose the following linear fitting graph
The height relationship between parents and sons
The height relationship between father and son
Enter the table, perform simple sorting, filter out the "daughters" in the table, right-click any "son", select "filter", select "filter by the value of the selected cell", you can filter out all "daughters", and then Start to generate regression fitting graph. Generate fitting graph
with father's height as y value and son's height as y value. Click to confirm. The effect is as follows. The
layout is too dense, you can double-click the horizontal and vertical coordinates to set
The display method of the regression equation is: right-click the yellow dot, select "add trend line", check "show formula" and "show R-squared value"
The analysis shows that the regression equation has a large deviation, so it is not true
The regression analysis generated by Excel can get the regression equation as
y=0.2547x+49.872.
When the father's height is 75 inches, the son's height is about 69 inches
The height relationship between mother and son
The operation is similar to the previous step. Just change the value of x to the height of the mother. The
generated regression analysis is as follows. The
deviation is also large, and the regression equation does not hold.
As for the custom, "the height of the father means the height of the son, and the height of the father means that the son is short" (that is, the height of the father is related to the height of the son, and is positively correlated), "the height of the mother is one litter, and the height of the father is one" (that is, the height of the mother is higher than the The height of the father has a greater impact on the children)” According to the regression analysis, I don’t think it is true.
Multiple linear regression
Choose the height of the father and mother when choosing the value of x.
The regression analysis generated is as
follows: From the third table, the regression equation
y=22.29324+0.378453x1+0.285201x2
y is the height of the son, x1 and x2 are the heights of the parents respectively