Excel Linear Regression Analysis

Excel Linear Regression Analysis

The data set download address is placed at the end of the article

How does Excel perform linear analysis?

As a computer-related field, Internet of Things engineering mostly uses programming to implement data analysis, and some fields such as mathematics, finance, and finance do not use programming languages ​​​​like Python, but use Excel for data analysis , Microsoft has also added a plug-in installation option in Excel, which can facilitate us to use Excel for data analysis and other tasks

Excel installation related add-ins

Here we need to perform linear regression processing on the data, so we need to install related plug-ins:

  • Analysis ToolPak

  • Analysis ToolPak VBA

The steps to add are as follows:

After the addition is successful, the data analysis column will appear under the data option in our menu bar, and we can use the data analysis function for data analysis:

Data Processing and Regression Analysis

Here we need to perform linear regression analysis on 20, 200, and 2000 sets of data respectively. First, we need to select the corresponding amount of data, and then we can view the data distribution by inserting a chart. Here we choose to insert the simplest scatter plot

We double-click the axis option and modify it until we can clearly see the data in our graph

Here we can clearly see the different scatter plots corresponding to our 20, 200, and 2000 sets of data

image

Finally, we perform data analysis:

Trend curve:

Right-click the data point on our graph, and then select Add Trend Curve. For the trend curve type here, we choose straight line, check the display formula and display R square value, and we can see the complete regression equation and the corresponding trend curve:

Perform regression analysis:

We want to analyze the data, select regression in the data analysis, then set our data input area, select what we want to display, and finally generate:

Note: here the x, y value input area selects the x, y data we want

20 sets of data regression analysis results:

200 sets of data regression analysis results:

2000 sets of data regression analysis results:

Summarize

In this blog, we initially entered the data processing part. Although we only did simple data processing through Excel, we can still see the results of our regression analysis intuitively and get the asymptote of the regression equation

When we use Excel for data processing, we need to pay attention to the following points:

  • Be sure to add the plug-in first, some people will find that the data analysis cannot be found, indicating that the plug-in has not been added first

  • Don't get our data wrong, some people reversed the x and y input data, and the regression equation obtained is inconsistent with the one shown above, but this does not affect our analysis of the data, it is just that we need to analyze the relationship between weight and height effect, sounds a little unreasonable

Data download address

weights_heights (height-weight data set).xls

Guess you like

Origin blog.csdn.net/m0_59161987/article/details/129471707