Beruflich Dokumente
Kultur Dokumente
How can we use data to make predictions? Data usually are scattered around, we plot them
to a graph and get a scattergraph, we call the data set Xs on the X axis.
We want to predict when we will get a given Y on the vertical axis when we get an X. How?
We can make an equation if we get the average of the squared Xs, to make an average line.
This is a Regression equation. We can then say Y= 2.0 + 4/3X + e (rounding error).
Do we see how this equation seems to fit the data ? If X = 6? Y = 2.0 + 4/3 (6) =?)
Why cant we average the Xs, not the squares? Try to average:
1.3X 1.3X + 1.3 X 1.3X etc.. What happens? Or here (6-4)+ (2-4) + (3-6) + (7+3)?
If an average is made up of differences like 2 + 4 + 4 +2 / n = 12/4 =3. Then what happens
when we subtract all the differences from the average? 2-3 + 4-3 + 4-3 + 2-3=?
So use squares, eliminates the negatives.
Simple linear Regression
A simple linear model in which the value of one variable can be used to predict the value
of an outcome variable. The formula for a straight line is the basis for this model:
Yi = (b0+b1Xi) + i
Simple linear regression models can be represented as 'lines of best fit' or regression lines
on scatterplots (shown below).
Homework: Obtain a series of data by year, like GDP in the USA or Stock Prices for
a company, and get 12 data points (months or years for example). Then use Excel to
get this result. Due by end of the week.
9. Under Titles,
a. click in the text box under Chart title: and enter a title for the graph.
b. click in the text box under Category (X) axis: and enter a title for the x-axis.
c. click in the text box under Value (Y) axis: and enter a title for the y-axis.
10. Click on the Gridlines tab. Click in the checkboxes to turn gridlines on or off.
11. Click on the Legend tab. Click in the checkbox next to Show legend to turn the legend
on or off. Placement of the legend on the graph can also be selected here.
12. Click on the Data Labels tab. Click on the radio buttons to turn data labels on or off.
13. Click on the Data Table tab. Click in the checkboxes to turn a data table on or off.
14. Click on Next>.
15. Under Place chart:, click on the radio button next to As new sheet:. Enter a name for the
graph in the highlighted text box.
16. Click on Finish. At this point you have created an X-Y plot of the data.
a. Move the mouse cursor to any data point and press the left mouse button. All of
the data points should now be highlighted. Now, while the mouse cursor is still on
any one of the highlighted data points, press the right mouse button, and click on
Add Trendline... from the menu that appears.
b. From within the Add Trendline window, under Type, click on the box with the
type of fit you want (e.g., Linear).
c. Click on Options at the top of the Add Trendline window.
d. Click in the checkbox next to Display equation on chart and the checkbox next
to Display R-squared value on chart. Do not click on the checkbox next to "Set
Intercept = 0".
e. Click on OK.