# 10_16 - STAT 420 Examples for Fall 2007 The data in...

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

STAT 420 Examples for 10/16/2007 Fall 2007 The data in http://www.stat.uiuc.edu/~stepanov/varsttr.csv are the salaries, y , and years of experience, x , for a sample of 50 Initech employees. > varsttr.dat <- read.table("http://www.stat.uiuc.edu/~stepanov/varsttr.csv", sep=",", header=T) > varsttr.dat x y 1 7 26075 2 28 79370 3 23 65726 4 18 41983 5 19 62308 6 15 41154 7 24 53610 8 13 33697 9 2 22444 10 8 32562 11 20 43076 12 21 56000 13 18 58667 14 7 22210 15 2 20521 16 18 49727 17 11 33233 18 21 43628 19 4 16105 20 24 65644 21 20 63022 22 20 47780 23 15 38853 24 25 66537 25 25 67447 26 28 64785 27 26 61581 28 27 70678 29 20 51301 30 18 39346 31 1 24833 32 26 65929 33 20 41721 34 26 82641 35 28 99139 36 23 52624 37 17 50594 38 25 53272 39 26 65343 40 19 46216 41 16 54288 42 3 20844 43 12 32586 44 23 71235 45 20 36530 46 19 52745 47 27 67282 48 25 80931 49 12 32303 50 11 38371 Consider the first-order model Y = β 0 + β 1 x 1 + ε . > varsttr.fit1 <- lm(y ~ x, data=varsttr.dat) > > plot(varsttr.dat\$x,varsttr.dat\$y) > abline(varsttr.fit1\$coefficients)

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

View Full Document
> summary(varsttr.fit1) Call: lm(formula = y ~ x, data = varsttr.dat) Residuals: Min 1Q Median 3Q Max -17665.6 -5497.7 -725.7 4667.3 27812.9 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 11369.4 3160.2 3.598 0.000757 *** x 2141.3 160.8 13.314 < 2e-16 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 8642 on 48 degrees of freedom Multiple R-Squared: 0.7869, Adjusted R-squared: 0.7825 F-statistic: 177.3 on 1 and 48 DF, p-value: < 2.2e-16 > par(mfrow=c(2,2)) > plot(varsttr.fit1)
Consider the second-order model Y = β 0 + β 1 x 1 + β 2 x 1 2 + ε . > varsttr.fit2 <- lm(y ~ x + I(x^2), data=varsttr.dat)

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 04/29/2010 for the course STAT stat 420 taught by Professor Stepanov during the Spring '07 term at University of Illinois at Urbana–Champaign.

### Page1 / 11

10_16 - STAT 420 Examples for Fall 2007 The data in...

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

View Full Document
Ask a homework question - tutors are online