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_1.pdf") > > # RPD Problem 1.1 > > > ozone <- c(0.02, 0.07, 0.11, 0.15) > yield <- c(242, 237, 231, 201) > > ozone [1] 0.02 0.07 0.11 0.15 > yield [1] 242 237 231 201 > > plot(ozone,yield) > > ozyld.reg <- lm(yield ~ ozone) > > summary(ozyld.reg) Call: lm(formula = yield ~ ozone) Residuals: 1 2 3 4 -5.563 4.113 9.854 -8.404 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 253.43 10.77 23.537 0.0018 ** ozone -293.53 107.81 -2.723 0.1126 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 10.38 on 2 degrees of freedom Multiple R-squared: 0.7875, Adjusted R-squared: 0.6813 F-statistic: 7.413 on 1 and 2 DF, p-value: 0.1126 > > predict(ozyld.reg) 1 2 3 4 247.5633 232.8868 221.1456 209.4043 > > resid(ozyld.reg) 1 2 3 4 -5.563342 4.113208 9.854447 -8.404313 > > predict(ozyld.reg,int="c") fit lwr upr 1 247.5633 209.1009 286.0258 2 232.8868 209.1203 256.6533 3 221.1456 196.4903 245.8008 4 209.4043 172.8052 246.0034 > > predict(ozyld.reg,int="p") fit lwr upr 1 247.5633 188.6129 306.5138 2 232.8868 182.2840 283.4895 3 221.1456 170.1193 272.1718 4 209.4043 151.6524 267.1562 > > dev.off() null device 1 >