outlier - 11 12 13 14 15 4.143644e-02 1.889847e-02...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
Outlier Identification > library(TeachingDemo) > if(interactive( )){ put.points.demo( ) x <- rnorm(25, 5, 1) y <- x + rnorm(25) put.points.demo(x,y) } Rat data > library(alr3) > data(rat) > pairs(rat)
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
> summary(m1 <- lm(y ~ ., rat))$coef Estimate Std. Error t value Pr(>|t|) (Intercept) 0.26592177 0.194585255 1.3666080 0.19188433 BodyWt -0.02124634 0.007974304 -2.6643501 0.01767688 LiverWt 0.01429806 0.017217141 0.8304549 0.41930376 Dose 4.17811141 1.522625206 2.7440183 0.01506639 > inf.index(m1, outlier.t.test = FALSE)
Background image of page 2
> summary(update(m1, subset = -3))$coef Estimate Std. Error t value Pr(>|t|) (Intercept) 0.311427385 0.20509398 1.5184618 0.1511537 BodyWt -0.007783059 0.01871680 -0.4158329 0.6838360 LiverWt 0.008989337 0.01865861 0.4817795 0.6374069 Dose 1.484876661 3.71306448 0.3999060 0.6952607 > m1cook <- cooks.distance(m1) 1 2 3 4 5 1.688268e-01 8.854024e-02 9.296160e-01 5.718456e-02 2.029162e-01 6 7 8 9 10 4.874208e-04 2.461564e-02 4.685795e-02 4.883028e-04 5.229549e-05
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 11 12 13 14 15 4.143644e-02 1.889847e-02 2.726019e-01 5.370022e-03 3.733265e-03 16 17 18 19 5.099189e-02 4.249284e-03 3.162543e-02 1.999403e-01 &gt; rstudent(m1) 1 2 3 4 5 1.91707187 -1.30223132 0.79729151 -1.42358040 -1.13373058 6 7 8 9 10 0.09735516 0.77749372 0.73096918 0.15945406 -0.03789644 11 12 13 14 15 -1.11390438 0.58915211 -1.61605136 -0.36576366 0.41363731 16 17 18 19 -0.85092807 -0.25632639 0.84267108 2.13883322 &gt; m1inf &lt;- influence (m1) &gt; m1inf$hat 1 2 3 4 5 6 0.17798270 0.17934099 0.85091457 0.10761585 0.39153825 0.16115958 7 8 9 10 11 12 0.13688107 0.25367448 0.06701578 0.11968672 0.11950583 0.17239599 13 14 15 16 17 18 0.31618336 0.13140699 0.07617481 0.21661460 0.19522441 0.14872221 19 0.17796183 &gt; influence.measures (m1) &gt; qqnorm(residuals(m1) ,main=&quot;&quot;) &gt; qqline(residuals(m1) , main=&quot;&quot;) &gt; library(car) &gt; vif(m1) BodyWt LiverWt Dose 52.101917 1.335679 51.427154...
View Full Document

Page1 / 4

outlier - 11 12 13 14 15 4.143644e-02 1.889847e-02...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online