Presentation is loading. Please wait.

Presentation is loading. Please wait.

Announcements: Homework 10: –Due next Thursday (4/25) –Assignment will be on the web by tomorrow night.

Similar presentations


Presentation on theme: "Announcements: Homework 10: –Due next Thursday (4/25) –Assignment will be on the web by tomorrow night."— Presentation transcript:

1 Announcements: Homework 10: –Due next Thursday (4/25) –Assignment will be on the web by tomorrow night.

2 4321 18 17 16 15 14 13 12 11 10 9 Fabric B u r n T i m e Vertical spread of data points within each oval is one type of variability. Vertical spread of the ovals is another type of variability.

3 Suppose there are k treatments and n data points. ANOVA table: Source Sum ofMean of VariationdfSquaresSquare F P Treatmentk-1SSTMST=SST/(k-1)MST/MSE Errorn-kSSEMSE=SSE/(n-k) Totaln-1total SS ESTIMATE OF “WITHIN FABRIC TYPE” VARIABILITY ESTIMATE OF “ACROSS FABRIC TYPE” VARIABILITY “SUM OF SQUARES” IS WHAT GOES INTO NUMERATOR OF s 2 : “(X 1 -X) 2 + … + (X n -X) 2” P-VALUE FOR TEST OF All Means equal. (REJECT IF LESS THAN  )

4 One-way ANOVA: Burn Time versus Fabric Analysis of Variance for Burn Time Source DF SS MS F P Fabric 3 109.81 36.60 27.15 0.000 Error 12 16.18 1.35 Total 15 125.99 Explaining why ANOVA is an analysis of variance: MST = 109.81 / 3 = 36.60 Sqrt(MST) describes standard deviation among the fabrics. MSE = 16.18 / 12 = 1.35 Sqrt(MSE) describes standard deviation of burn time within each fabric type. (MSE is estimate of variance of each burn time.) F = MST / MSE = 27.15 It makes sense that this is large and p-value = Pr(F 4-1,16-4 > 27.15) = 0 is small because the variance “among treatments” is much larger than variance within the units that get each treatment. (Note that the F test assumes the burn times are independent and normal with the same variance.) For test: H 0 :        

5 It turns out that ANOVA is a special case of regression. We’ll come back to that in a class or two. First, let’s learn about regression (chapters 12 and 13). Simple Linear Regression example: Ingrid is a small business owner who wants to buy a fleet of Mitsubishi sigmas. To save $ she decides to buy second hand cars and wants to estimate how much to pay. In order to do this, she asks one of her employees to collect data on how much people have paid for these cars recently. (From Matt Wand)

6 151413121110 9 8 7 6 9000 8000 7000 6000 5000 4000 3000 2000 1000 0 Age (years) Regression Plot Data: Each point is a car Price ($)

7 Plot suggests a simple model: Price of car = intercept + slope times car’s age + error or y i =  0 +  1 x i +  i, i = 1,…,39. Estimate  0 and  1. Outline for Regression: 1.Estimating the regression parameters and ANOVA tables for regression 2.Testing and confidence intervals 3.Multiple regression models & ANOVA 4.Regression Diagnostics

8 Plot suggests a model: Price of car = intercept + slope times car’s age + error or y i =  0 +  1 x i +  i, i = 1,…,39. Estimate  0 and  1 with b 0 and b 1. Find these with “least squares”. In other words, find b 0 and b 1 to minimize sum of squared errors: SSE = {y 1 – (b 0 + b 1 x 1 )} 2 + … + {y n – (b 0 + b 1 x n )} 2 See green line on next page. Each term is squared difference between observed y and the regression line ((b 0 + b 1 x 1 )

9 Squared length of this line contributes one term to Sum of Squared Errors (SSE) This line has length y i – b 0 – b 1 x i for some i 151413121110 9 8 7 6 9000 8000 7000 6000 5000 4000 3000 2000 1000 0 Age P r i c e S = 1075.07 R-Sq = 43.8 % R-Sq(adj) = 42.2 % Price = 8198.25 - 385.108 Age Regression Plot

10 151413121110 9 8 7 6 9000 8000 7000 6000 5000 4000 3000 2000 1000 0 Age (years) S = 1075.07 R-Sq = 43.8 % R-Sq(adj) = 42.2 % General Model: Price =  0 +  1 Age + error Fitted Model: Price = 8198.25 - 385.108 Age Regression Plot Price ($) Do Minitab example

11 Regression parameter estimates, b 0 and b 1, minimize SSE = {y 1 – (b 0 + b 1 x 1 )} 2 + … + {y – (b 0 + b 1 x n )} 2 Full model is y i =  0 +  1 x i +  i Suppose errors (  i ’s) are independent N(0,  2 ). What do you think a good estimate of  2 is? MSE = SSE/(n-2) is an estimate of  2. Note how SSE looks like the numerator in s 2.

12 (I divided price by $1000. Think about why this doesn’t matter.) Source DF SS MS F P Regression 1 33.274 33.274 28.79 0.000 Residual Error 37 42.763 1.156 Total 38 76.038 Sum of Squares Total = {y 1 –mean(y)} 2 + … + {y 39 – mean(y)} 2 = 76.038 Sum of Squared Errors = {y 1 – (b 0 + b 1 x 1 )} 2 + … + {y – (b 0 + b 1 x n )} 2 = 42.763 Sum of Squares for Regression = SSTotal - SSE What do these mean?

13 Overall mean of $3,656 Regression line 151413121110 9 8 7 6 9000 8000 7000 6000 5000 4000 3000 2000 1000 0 Age P r i c e S = 1075.07 R-Sq = 43.8 % R-Sq(adj) = 42.2 % Price = 8198.25 - 385.108 Age Regression Plot

14 (I divided price by $1000. Think about why this doesn’t really matter.) Source DF SS MS F P Regression 1=p-1 33.274 33.274 28.79 0.000 Residual Error 37=n-p 42.763 1.156 Total 38=n-1 76.038 p is the number of regression parameters (2 for now) SSTotal = {y 1 –mean(y)} 2 + … + {y 39 – mean(y)} 2 = 76.038 SSTotal / 38 is an estimate of the variance around the overall mean. (i.e. variance in the data without doing regression) SSE = {y 1 – (b 0 + b 1 x 1 )} 2 + … + {y – (b 0 + b 1 x n )} 2 = 42.763 MSE = SSE / 37 is an estimate of the variance around the line. (i.e. variance that is not explained by the regression) SSR = SSTotal – SSE MSR = SSR / 1 is the variance the data that is “explained by the regression”.

15 (I divided price by $1000. Think about why this doesn’t really matter.) Source DF SS MS F P Regression 1=p-1 33.274 33.274 28.79 0.000 Residual Error 37=n-p 42.763 1.156 Total 38=n-1 76.038 p is the number of regression parameters A test of H 0 :  1 = 0 versus H A : parameter is not 0 Reject if the variance explained by the regression is high compared to the unexplained variability in the data. Reject if F is large. F = MSR / MSE p-value is Pr(F p-1,n-p > MSR / MSE) Reject H 0 for any  less than the p-value (Assuming errors are independent and normal.)

16 R2R2 Another summary of a regression is: R 2 =Sum of Squares for Regression Sum of Squares Total 0<= R 2 <= 1 This is the percentage of the of variation in the data that is described by the regression.

17 Two different ways to assess “worth” of a regression 1.Absolute size of slope: bigger = better 2.Size of error variance: smaller = better 1.R 2 close to one 2.Large F statistic


Download ppt "Announcements: Homework 10: –Due next Thursday (4/25) –Assignment will be on the web by tomorrow night."

Similar presentations


Ads by Google