Math 151 , Spring 2004, Monday Day 16, March 8After class Hit reload to get most current

Friday, Optional class--email me--Or some writing (do separate from other HW) See Day 15
Homework:  Reading:  Finish Sec. 2.3.  Sec. 2.4.  Skip 2.5. Ahead, Ch. 3 Intro.  Ch. 3.
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  againDoes 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
p. 131, 2.53 farm population (SPSS)
   Also connect the dots, or plot the residuals--is there any curve to the relationship?
Postpone the rest to the next asst.
p. 132  2.54 Dow average/stocks
p. 138 2.63 math&verbal r, states/individuals
C.  Look again at p. 122, 2.37(calories).   These values are averaged values, over a bunch of people's guesses.  What would the graph look like if all the individuals' separate guesses had been graphed?  Add points to your graph to give the idea.

Read, to dis
cuss 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

 

Optional 
SPSS finds residuals: 
see Day 15
HW
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

 

Mopping up 2-variable :  4 facts,  Day 14

The line formula yhat = a + bx  from xbar, ybar, sx , sy , r:
     Find b:   b = r  sy / sx
                (Fact 2r 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.

    r2 is the square of the correlation coefficient r!  (-, + Sign gets lost.)
    If r = .7, about half (.49) of the variability  in the y's is explained by using the regression line relationship to predict y from x. (If weight and height have a correlation of .7, then half of the variability in weight can be explained by knowing height.)
 ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
Plotting residuals:  This amounts to making the regression line into a new x-axis--If you plot the residuals themselves vs. the original x values, without the distraction of the slanted line, outliers and patterns other than the linear (if any) can emerge.

(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
This page belongs to Sally Sievers who is solely responsible for its content. Please see our statement of responsibility.