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(4.608165695 + ,4.62399194 + ,4.625952725 + ,4.636668853 + ,4.641502115 + ,4.665324109 + ,4.679349584 + ,4.699570861 + ,4.715816706 + ,4.744062185 + ,4.753590191 + ,4.773223771 + ,4.790819533 + ,4.836281907 + ,4.852811209 + ,4.868303386 + ,4.873669439 + ,4.894850261 + ,4.899331225 + ,4.90897164 + ,4.914124394 + ,4.935193099 + ,4.934473933 + ,4.93878119 + ,4.932313327 + ,4.948050419 + ,4.95088529 + ,4.954417614 + ,4.955827058 + ,4.973279508 + ,4.97397131 + ,4.980176087 + ,4.989071116 + ,5.007296393 + ,5.009968405 + ,5.011301739 + ,5.016617366 + ,5.029129877 + ,5.031091303 + ,5.036952602 + ,5.042779747 + ,5.05560866 + ,5.065123479 + ,5.073297055 + ,5.076423035 + ,5.094976443 + ,5.098035484 + ,5.102302483 + ,5.098035484 + ,5.108971195 + ,5.109575242 + ,5.11679549 + ,5.120983351 + ,5.139321635 + ,5.14107859 + ,5.147494477 + ,5.14633101 + ,5.158480421 + ,5.159055299 + ,5.157905213 + ,5.158480421 + ,5.170483995 + ,5.173887288 + ,5.182906515 + ,5.188502501 + ,5.200153118 + ,5.202907182 + ,5.208939555 + ,5.21384821 + ,5.227358278 + ,5.23324537 + ,5.242804657 + ,5.245443877 + ,5.256974403 + ,5.260615499 + ,5.26631057 + ,5.268888556 + ,5.286244785 + ,5.294811227 + ,5.30529298 + ,5.313205979 + ,5.32933142 + ,5.333201768 + ,5.346154696 + ,5.352331955 + ,5.372032404 + ,5.381738975 + ,5.37296091 + ,5.351384087 + ,5.359412466) > x <- c(11.57467886 + ,11.60253762 + ,11.66544052 + ,11.72235136 + ,11.65106 + ,11.67780411 + ,11.74772878 + ,11.78474489 + ,11.6997867 + ,11.72634994 + ,11.77385023 + ,11.80157956 + ,11.71983394 + ,11.73940744 + ,11.77681933 + ,11.7982247 + ,11.70729087 + ,11.71213691 + ,11.76222787 + ,11.7871879 + ,11.695472 + ,11.71994776 + ,11.77614321 + ,11.79451904 + ,11.72595403 + ,11.73551686 + ,11.80294979 + ,11.82449739 + ,11.75594223 + ,11.76714124 + ,11.82912939 + ,11.84736707 + ,11.76821089 + ,11.78755269 + ,11.84519603 + ,11.87147365 + ,11.80520694 + ,11.82858256 + ,11.88355065 + ,11.91355892 + ,11.84076051 + ,11.87240248 + ,11.91861721 + ,11.94929475 + ,11.88371631 + ,11.91010299 + ,11.96081129 + ,11.98970608 + ,11.93670189 + ,11.97041993 + ,12.0034545 + ,12.04337135 + ,11.99701073 + ,12.0183264 + ,12.04707691 + ,12.07071673 + ,12.02193344 + ,12.04496449 + ,12.07909118 + ,12.11206961 + ,12.0565164 + ,12.08872951 + ,12.11315111 + ,12.14467585 + ,12.0831307 + ,12.11873212 + ,12.14403233 + ,12.17895835 + ,12.11743813 + ,12.15222873 + ,12.17460778 + ,12.20856454 + ,12.14495228 + ,12.17423104 + ,12.1915984 + ,12.23144795 + ,12.16395293 + ,12.189435 + ,12.20499206 + ,12.24221169 + ,12.18638511 + ,12.21018418 + ,12.2343831 + ,12.2666455 + ,12.21011447 + ,12.22432014 + ,12.24185476 + ,12.25918678 + ,12.18031885 + ,12.2918833) > par2 = '36' > 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 -0.0780346621 2 -0.0895578675 3 -0.1493500013 4 -0.1945042780 5 -0.1196829938 6 -0.1221161781 7 -0.1767370209 8 -0.1928551311 9 -0.0932042887 10 -0.0910364246 11 -0.1281403156 12 -0.1357291222 13 -0.0378822011 14 -0.0116354874 15 -0.0318341169 16 -0.0373559802 17 0.0572814644 18 0.0737048409 19 0.0290106002 20 0.0141473007 21 0.1093392186 22 0.1063796257 23 0.0504923663 24 0.0367597375 25 0.0976033894 26 0.1039524776 27 0.0405872171 28 0.0229658711 29 0.0916771601 30 0.0981353387 31 0.0379722486 32 0.0262727641 33 0.1128768519 34 0.1121139327 35 0.0581964314 36 0.0337325489 37 0.1041034080 38 0.0936676485 39 0.0416659027 40 0.0180675383 41 0.0953622039 42 0.0771276206 43 0.0412726002 44 0.0193294783 45 0.0868350033 46 0.0794841286 47 0.0327619109 48 0.0086623701 49 0.0564305466 50 0.0342646456 51 0.0024380556 52 -0.0295287927 53 0.0201721306 54 0.0175844344 55 -0.0088835082 56 -0.0256752616 57 0.0210527128 58 0.0105921239 59 -0.0223357892 60 -0.0558613986 61 -0.0007485959 62 -0.0203692167 63 -0.0409410517 64 -0.0628702343 65 0.0031457427 66 -0.0201542006 67 -0.0422378120 68 -0.0704929468 69 -0.0051887751 70 -0.0258332707 71 -0.0419160983 72 -0.0656927790 73 -0.0006042486 74 -0.0178172128 75 -0.0312259694 76 -0.0646519250 77 0.0041871474 78 -0.0034728343 79 -0.0101790405 80 -0.0362364739 81 0.0264824920 82 0.0192439540 83 -0.0006422170 84 -0.0193618728 85 0.0423129246 86 0.0480674095 87 0.0405599257 88 0.0147667021 89 0.0706159576 90 -0.0308805092 > library(lattice) > postscript(file="/var/www/html/rcomp/tmp/1k14r1257179426.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/2d9nv1257179426.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/3tzmj1257179426.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/4bnm41257179426.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/51mtj1257179426.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/6hetp1257179426.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/724yo1257179426.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/8mqh61257179426.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() + } null device 1 > summary(x) Min. 1st Qu. Median Mean 3rd Qu. Max. 11.57 11.78 11.93 11.95 12.14 12.29 > > #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/92v9m1257179426.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/1059b81257179427.tab") > > system("convert tmp/1k14r1257179426.ps tmp/1k14r1257179426.png") > system("convert tmp/2d9nv1257179426.ps tmp/2d9nv1257179426.png") > system("convert tmp/3tzmj1257179426.ps tmp/3tzmj1257179426.png") > system("convert tmp/4bnm41257179426.ps tmp/4bnm41257179426.png") > system("convert tmp/51mtj1257179426.ps tmp/51mtj1257179426.png") > system("convert tmp/6hetp1257179426.ps tmp/6hetp1257179426.png") > system("convert tmp/724yo1257179426.ps tmp/724yo1257179426.png") > system("convert tmp/8mqh61257179426.ps tmp/8mqh61257179426.png") > > > proc.time() user system elapsed 1.619 1.184 2.738