> mapdist <- read.table("C:\\data\\CH03TA01.txt",header=F,col.names=c("Y","X")) > > attach(mapdist) The following object(s) are masked from 'mapdist (position 3)': X, Y > > pdf("C:\\Rmisc\\graphs\\KLLN_TA3_01.pdf") > > mapdist.reg1 <- lm(Y ~ X) > > summary(mapdist.reg1) Call: lm(formula = Y ~ X) Residuals: Min 1Q Median 3Q Max -1.0625 -0.5491 0.1295 0.6009 1.0286 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) -1.816071 1.051849 -1.727 0.13500 X 0.043482 0.006706 6.484 0.00064 *** --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Residual standard error: 0.8692 on 6 degrees of freedom Multiple R-squared: 0.8751, Adjusted R-squared: 0.8543 F-statistic: 42.04 on 1 and 6 DF, p-value: 0.0006397 > > plot(X,Y,xlim=c(60,260),ylim=c(0,10),main="Y vs X and Fitted equation") > abline(a=mapdist.reg1$coef[1],b=mapdist.reg1$coef[2]) > > Residual <- resid(mapdist.reg1) > > plot(X,Residual,xlab="Maps Distributed",ylab="Residual",main="Residuals vs X") > abline(h=0) > > > > > > dev.off()