0 Regression Model Development and Yet Another Regression Function Werner Stahel Seminar f ¨ u r Statistik, ETH Z ¨ u rich useR 2008, Dortmund
1 Data Analysis ... needs a system that gives MORE support. I show you such a system for regression models Regression ... is 80% of statistics that is worthwile. Model checking and often model development is needed. Overview of talk: Example, conclusions
2 Example Blasting for tunnel excavation. Tremor in a house (meas.site) must not exceed a threshold. Need a forecast of target variable, from tremor between blasting site and measurement location distance and charge house (factor) location
3 > showd(d.blast) charge distance tremor location 1 0.952 44 2.93 loc5 98 0.952 69 1.76 loc1 195 0.952 108 0.62 loc6 316 7.072 93 5.15 loc3 50 5.493 36 21.34 loc2 171 5.285 46 10.19 loc8 388 3.952 77 3.95 loc3 Yes, this is the data I wanted. − → Regression! r.blast.lm0 <- lm(tremor~location+distance+charge, data=d.blast) plot(r.blast.lm0)
4 lm(tremor ~ location + distance + charge) Residuals vs Fitted Normal Q−Q 123 123 184 184 4 10 43 43 Standardized residuals 5 2 Residuals 0 0 −5 −2 −4 −2 0 2 4 6 8 10 12 14 −3 −2 −1 0 1 2 3 Fitted values Theoretical Quantiles Scale−Location Residuals vs Leverage 123 2.0 184 43 123 184 4 Standardized residuals 1.5 Standardized residuals 2 1.0 0 0.5 −2 97 Cook’s distance 0.0 −4 −2 0 2 4 6 8 10 12 14 0.00 0.02 0.04 0.06 0.08 0.10 0.12 Fitted values Leverage
5 Wrong model! Take logs of tremor , distance , charge ! lm(log10(tremor) ~ location + log10(distance) + log10(charge)) Residuals vs Fitted Normal Q−Q 0.4 2 0.2 Standardized residuals 0.0 0 Residuals −0.2 −2 −0.4 170 −0.6 170 −4 97 −0.8 97 112 −6 −1.0 112 0.0 0.2 0.4 0.6 0.8 1.0 1.2 −3 −2 −1 0 1 2 3 Fitted values Theoretical Quantiles Scale−Location Residuals vs Leverage 2.5 112 2 97 2.0 170 Standardized residuals Standardized residuals 0 1.5 −2 1.0 −4 170 0.5 97 0.5 −6 112 Cook’s distance 0.0 0.0 0.2 0.4 0.6 0.8 1.0 1.2 0.00 0.02 0.04 0.06 0.08 0.10 0.12 Fitted values Leverage
6 Using regr ! r.blast <- regr(log10(tremor)~location+ log10(distance)+log10(charge), data=d.blast) log10(tremor)~location + log10(distance) + log10(charge) 50 6 8 60 94 290 90 264 328 345 98 355 + + + 0.2 + + + + + + + + + + + + + + + + + + + + + + + 5 + + + + + + + 359 + + + + + + + + + + + + + + + + + + + + + + + + + + + | st.res( Y ) | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 4 + + + + + + + + + + + res( Y ) + + + + + + + + 272 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0.0 + + + + + + ++ + + + + + + + + + + + + + + + + + + + + + + + 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + 15 360 + + + + + + + + + + + + + + + + + + + + + + + + + 27 + + + + + + + + + + + + + + + + + + + + + 60 94 + + 8 + + + + + + 290 25 13 + + + + + + + 2 14 + 296 + + + + + + 264 90 + + + + + + + + + + + + + + + + 355 + 328 + + 345 + 98 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + −0.2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 14 296 + + + + + + + + + + + 25 13 + + + + + + + + + + + 27 15 360 + + + + + + + + + + + + + + + + + 359 272 + + + + + + + + + + + + + + + + + + + 50 + + + + + + + + + + + + + + + + + + + + + + + ++ + + + + + + + + + + + + + + + + + + + + + + + + + + 0.0 0.2 0.4 0.6 0.8 1.0 1.2 0.0 0.2 0.4 0.6 0.8 1.0 1.2 Fitted Values Fitted Values 8 6094 290 94 60 8 290 90 264 2 264 90 328 355 1.5 98 345 355 + 328 + 345 + + 98 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 343 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 347 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + + + + + + + + 327 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + st.res( Y ) + + + + + st.res( Y ) + + + + + + + + + + + + 0.5 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 351 + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + −2 + + + + + 296 14 + + + + + + + 25 + ++ + + + + + 13 + + + + + + + + 331 339 + + + + + + + + + + + + 27 + + + + + + + + + + + −0.5 + + + + + + 360 15 + + + + + + + + + + + + + + + + + + + 335 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 272 + + Aug 11,00/3:02 | regr demo | blasting Aug 11,00/3:02 | regr demo | blasting Aug 11,00/3:02 | regr demo | blasting Aug 11,00/3:02 | regr demo | blasting −4 ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 359 + −1.5 + + + + + + + + + + + + + + + + −6 + + + 14 296 13 25 50 27 15 360 272 50 359 −3 −2 −1 0 1 2 3 0.02 0.04 0.06 0.08 0.10 0.12 Theoretical Quantiles hat diagonal
Recommend
More recommend