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. 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. > y <- c(100,83,83,83,82,71,82,86,64,66,63,67,41,65,68,90,98,108,92,100,87,91,77,72,59,55,69,71,88,88,97,94,82,75,66,71,83,97,88,89,70) > x <- c(.309,.333,.317,.305,.314,.310,.317,.317,.311,.314,.312,.319,.309,.305,.298,.320,.323,.338,.338,.324,.310,.322,.317,.309,.305,.310,.327,.323,.329,.328,.361,.346,.323,.322,.314,.317,.322,.334,.342,.340,.335) > par2 = '0' > par1 = '0' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Prof. Dr. P. Wessa > #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > #Technical description: > par1 <- as.numeric(par1) > par2 <- as.numeric(par2) > x <- as.ts(x) > y <- as.ts(y) > mylm <- lm(y~x) > cbind(mylm$resid) [,1] 1 28.10455159 2 -3.93320594 3 6.09196575 4 13.61084452 5 6.97168544 6 -1.52202164 7 5.09196575 8 9.09196575 9 -9.14859487 10 -9.02831456 11 -10.77516810 12 -11.16118071 13 -30.89544841 14 -4.38915548 15 2.99685713 16 11.21224606 17 17.33252636 18 17.93392790 19 1.93392790 20 18.70595313 21 14.47797836 22 10.95909959 23 0.09196575 24 0.10455159 25 -10.38915548 26 -17.52202164 27 -14.17376656 28 -9.66747364 29 3.57308698 30 4.19966021 31 -7.47725640 32 -1.07865794 33 1.33252636 34 -5.04090041 35 -9.02831456 36 -5.90803425 37 2.95909959 38 9.44022083 39 -4.57236502 40 -2.31921856 41 -18.18635240 > library(lattice) > postscript(file="/var/www/html/rcomp/tmp/1hrif1261324525.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(y,type='l',main='Run Sequence Plot of Y[t]',xlab='time or index',ylab='value') > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/2bniq1261324525.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(x,type='l',main='Run Sequence Plot of X[t]',xlab='time or index',ylab='value') > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/389dd1261324525.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(x,y,main='Scatter Plot',xlab='X[t]',ylab='Y[t]') > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/4eilc1261324525.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(mylm$resid,type='l',main='Run Sequence Plot of e[t]',xlab='time or index',ylab='value') > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/5dps21261324525.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > hist(mylm$resid,main='Histogram of e[t]') > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/6fw461261324525.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > if (par1 > 0) + { + densityplot(~mylm$resid,col='black',main=paste('Density Plot of e[t] bw = ',par1),bw=par1) + } else { + densityplot(~mylm$resid,col='black',main='Density Plot of e[t]') + } > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/7kqsf1261324525.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > qqnorm(mylm$resid,main='QQ plot of e[t]') > qqline(mylm$resid) > grid() > dev.off() null device 1 > if (par2 > 0) + { + postscript(file="/var/www/html/rcomp/tmp/8e6s51261324525.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) + acf(mylm$resid,lag.max=par2,main='Residual Autocorrelation Function') + grid() + dev.off() + } > summary(x) Min. 1st Qu. Median Mean 3rd Qu. Max. 0.2980 0.3110 0.3190 0.3212 0.3280 0.3610 > > #Note: the /var/www/html/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/rcomp/createtable") > > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,'Model: Y[t] = c + b X[t] + e[t]',2,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'c',1,TRUE) > a<-table.element(a,mylm$coeff[[1]]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'b',1,TRUE) > a<-table.element(a,mylm$coeff[[2]]) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/98f7k1261324525.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,'Descriptive Statistics about e[t]',2,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'# observations',header=TRUE) > a<-table.element(a,length(mylm$resid)) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'minimum',header=TRUE) > a<-table.element(a,min(mylm$resid)) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Q1',header=TRUE) > a<-table.element(a,quantile(mylm$resid,0.25)) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'median',header=TRUE) > a<-table.element(a,median(mylm$resid)) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'mean',header=TRUE) > a<-table.element(a,mean(mylm$resid)) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Q3',header=TRUE) > a<-table.element(a,quantile(mylm$resid,0.75)) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'maximum',header=TRUE) > a<-table.element(a,max(mylm$resid)) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/102g0s1261324525.tab") > > try(system("convert tmp/1hrif1261324525.ps tmp/1hrif1261324525.png",intern=TRUE)) character(0) > try(system("convert tmp/2bniq1261324525.ps tmp/2bniq1261324525.png",intern=TRUE)) character(0) > try(system("convert tmp/389dd1261324525.ps tmp/389dd1261324525.png",intern=TRUE)) character(0) > try(system("convert tmp/4eilc1261324525.ps tmp/4eilc1261324525.png",intern=TRUE)) character(0) > try(system("convert tmp/5dps21261324525.ps tmp/5dps21261324525.png",intern=TRUE)) character(0) > try(system("convert tmp/6fw461261324525.ps tmp/6fw461261324525.png",intern=TRUE)) character(0) > try(system("convert tmp/7kqsf1261324525.ps tmp/7kqsf1261324525.png",intern=TRUE)) character(0) > try(system("convert tmp/8e6s51261324525.ps tmp/8e6s51261324525.png",intern=TRUE)) convert: unable to open image `tmp/8e6s51261324525.ps': No such file or directory. convert: missing an image filename `tmp/8e6s51261324525.png'. character(0) > > > proc.time() user system elapsed 1.461 1.030 2.058