| Hand in Wednesday
With four facts, from Day 14: See details there. C. (Scatterplot handout p. 3, problems 6-10) govsal on avgpay 2.33, 2.30, 2.35--Note Text &Excel files are put in order, so look different,+ Text is MISSING the 23rd point, (5,56). You can just type it in. 2.47, 2.51 E. RSquared + + + + + + + + Problems on residuals, influential points, r2 A. Use ResidualsRSquared from the website or the lab to graph these data sets, along with a graph of the residuals. Print the results, and describe the shape of the residuals (it may help to connect the dots with pencil, to see the pattern.) a) x 1 2 8 4 6 9 y 1 3 6 6 7 5 b) x 1 2 7 4 6 9 y 7 6 2 4 2 1 Moore p. 122, 2.36 speed&gas again a, b, c, d. There is a data file for problem 2.36, and its third column is the residuals (check them against the book). B. Use Author's website, http://www.whfreeman.com/scc, ...Correlation/regression. Make a cloud of data (about 15 points), put in the regression line. Play with an outlier: drag a point to the far left (right) and drag it up and down. Try it if it's in the middle range of x's. Write answer: Where is it most influential? Now add a bunch more points (50 is max.) Play with an outlier again. Does the outlier have more or less influence with a larger data set? Moore p. 123, 2.38 Gesell first word-point in middle of x range. Get the data into SPSS, delete child 19, graph and get the regression line and r2. Use the formula on p.117 and graph the line for the full data set by hand on your printout. r2 for the full data set is on p. 122. Moore p. 122, 2.37 Calories (You saved these, I think--or, from Moore's files, in TA02-04) Graph and get lines in SPSS with and without the outliers. Graph the line for "without outliers" by hand on the printout for "with outliers" so you can compare them better. Print one more graph (with outliers) and keep it for problem C below. Sec. 2.4
|
Read, to dis
cuss
|
Optional
SPSS finds residuals: see Day 15 HW
|
The line formula yhat = a + bx
from xbar, ybar, sx , sy , r:
Find b: b = r sy
/ sx
(Fact 2: r is slope if x and y are standardized.Equation
p. 109)
Find
a: Solve ybar = a
+ b xbar for a: a = ybar - b xbar
(Fact 3: (xbar, ybar) lies on the regression
line(s). Equation p. 109)
LEAST
SQUARES PROPERTY
"Residual at
x" = (y - yhat)
= distance between observed y and predicted
y (= what's left over after predicting)
( Positive if observed is bigger than predicted,
negative if observed is smaller than predicted)
Least squares principle: Find the line that minimizes
the sums of the squared residuals.(Here,
or
in Mac 101, ClassMaterials\Math151\ RegressionDemos\RegressionLine.xls,
Squares tab)
This method
of finding a "best fit" straight line for predicting y's from x's was derived
mathematically to work well with "joint normal" data--elliptical clouds.
For data of this sort, the line does give the mean of the
y's for each given x (at least in the abstract.)
Residuals drawn to line, govsal
data (download OK in lab)
Drawback if the data is not the "elliptical cloud" type:
Outliers get their residual distance
squared: May be very influential in determining where
line sits.
Especially if at lowest or highest x-values, may change slope of
line a lot.
Author's website,http://www.whfreeman.com/scc,
...Correlation/regression. Play with an outlier.
(Outliers
toward the middle x's may not change the slope, but may affect r, and r2.)
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
The Line formula yhat = a + bx
tells us our best prediction or estimate of a response (y) value
for a particular value of the explanatory (x) value. It says NOTHING
about how good that "best" is--that is, it says nothing about how tight
or scattered the data is around the line. R-squared does that
job.
(Here
or
ClassMaterials\Math151\RegressionDemos\ResidualsRSquared.xls
, Graph of Residuals tab.(doesn't have tiny unlined graph)
SPSS can make a new variable of residuals, which you then can use
to make a scatterplot. Optional HW.
=
=
= = = = = = = = = = = = = = =
Cautions Sec.
2.4
Plot the data:
Summary formulas and numbers don't tell the whole story. (Anscombe's
quartet, Moore p.127, 2.46-7)
Extrapolation--
extra (outside) polation (putting a point): Using the line to predict outside
the range of x's you have data for. Unavoidable if x is time; but
inevitably dangerous--nothing says the mechanism you see will persist in
a wider range. (Many relationships are curved or bent; but over short
intervals "pass for" straight. Straight may be a good approximation,
but only in the short run.)
Start here Wed.
Averaged data will
produce a stronger relationship (higher correlation, R2) than
the merged raw data from individuals (the averaging hides much variability)
Heating-degree days graph (TA 2.1, p. 86, 107: Each value represents
a month's average temperature and average fuel. If we graphed
the daily temperature and fuel use we would see a lot more scatter.
| Sievers home | Math151-Sp04/Days16.htm | 2pm | 3/8/04 |