H:\public_html\sta6208\rpd>C:\R-2.9.0\bin\Rterm --vanilla R version 2.9.0 (2009-04-17) Copyright (C) 2009 The R Foundation for Statistical Computing ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. Natural language support but running in an English locale R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > pdf("rpd1_12r.pdf") > > # Example 1.12 in RPD > > > dust <- c(75,100,150,350,600,900,1300,1650,2250) > rr <- c(1.10,1.05,0.97,1.90,1.83,2.45,3.70,3.52,4.16) > > rr_1 <- rr-1 > > rr_1 [1] 0.10 0.05 -0.03 0.90 0.83 1.45 2.70 2.52 3.16 > dust [1] 75 100 150 350 600 900 1300 1650 2250 > > plot(dust,rr_1) > abline(lm(rr_1 ~ dust -1)) > > dustrr.reg <- lm(rr_1 ~ dust -1) > > summary(dustrr.reg) Call: lm(formula = rr_1 ~ dust - 1) Residuals: Min 1Q Median 3Q Max -0.35983 -0.10862 -0.06121 0.04207 0.66632 Coefficients: Estimate Std. Error t value Pr(>|t|) dust 0.001564 0.000096 16.30 2.02e-07 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.3156 on 8 degrees of freedom Multiple R-squared: 0.9708, Adjusted R-squared: 0.9671 F-statistic: 265.5 on 1 and 8 DF, p-value: 2.024e-07 > > aov(dustrr.reg) Call: aov(formula = dustrr.reg) Terms: dust Residuals Sum of Squares 26.444117 0.796683 Deg. of Freedom 1 8 Residual standard error: 0.3155714 Estimated effects are balanced > > predict(dustrr.reg) 1 2 3 4 5 6 7 8 0.1173278 0.1564370 0.2346556 0.5475296 0.9386222 1.4079334 2.0336815 2.5812112 9 3.5198334 > > resid(dustrr.reg) 1 2 3 4 5 6 -0.01732778 -0.10643704 -0.26465556 0.35247036 -0.10862225 0.04206663 7 8 9 0.66631847 -0.06121117 -0.35983342 > > dev.off() null device 1 >