R version 2.8.0 (2008-10-20) Copyright (C) 2008 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(-10095.16,-10146.94,-10094.36,-10198.42,-10095.96,-10198.62,-10792.49,-10845.67,-10817.18,-10764.6,-10559.78,-10765.3,-10972.32,-11023.5,-11072.48,-10919.54,-10894.85,-10994.81,-11358.87,-11565.29,-11640.46,-11898.26,-11717.83,-11872.27,-11873.47,-11924.35,-11896.56,-11743.32,-11717.93,-11741.92,-12157.76,-12157.16,-12128.97,-11975.53,-11818.69,-11973.33,-12051.6,-12026.11,-11919.25,-11846.28,-11896.26,-11870.17,-12259.62,-12259.12,-12128.47,-11663.55,-11405.55,-11381.56,-11432.14,-11277.9,-10991.91,-10916.84,-10709.02,-10450.82,-11096.27,-11175.04,-10761,-10603.46,-10398.04,-10528.59,-10603.26,-10449.82,-10242.2,-10215.11,-9907.63,-10033.78,-10628.45,-10630.95,-10318.07,-10215.31,-10219.01,-10530.09,-10788.69,-10918.14,-11019.9,-11073.18,-10918.94,-11148.65) > x <- c(-9063.91,-9110.33,-9062.71,-9155.95,-9063.71,-9155.85,-9688.93,-9738.65,-9710.89,-9664.17,-9480.59,-9665.97,-9851.55,-9897.17,-9940.89,-9803.43,-9781.27,-9871.41,-10197.65,-10384.93,-10450.51,-10682.01,-10520.39,-10660.05,-10660.75,-10706.47,-10680.81,-10543.15,-10520.59,-10542.35,-10915.21,-10916.41,-10889.15,-10751.69,-10611.33,-10751.39,-10821.37,-10797.91,-10701.97,-10636.39,-10680.51,-10656.95,-11006.55,-11007.95,-10888.85,-10471.57,-10239.87,-10219.41,-10264.13,-10125.47,-9867.91,-9801.23,-9614.75,-9382.15,-9962.35,-10033.73,-9661.07,-9519.71,-9335.93,-9454.53,-9521.01,-9381.75,-9196.27,-9171.51,-8895.29,-9008.49,-9542.67,-9546.77,-9264.35,-9172.21,-9176.71,-9456.03,-9688.03,-9803.43,-9894.77,-9942.19,-9803.63,-10009.97) > 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.058565640 2 -0.019694693 3 -0.477972223 4 -0.688980268 5 -0.964190670 6 -1.000358423 7 -1.135688419 8 1.061530372 9 -1.367045526 10 -0.822919658 11 -0.470937066 12 0.481887136 13 0.157467648 14 -0.211817927 15 -0.497288452 16 -0.657700658 17 -0.649099861 18 -0.212830719 19 -0.912737033 20 1.256272119 21 -0.871933669 22 -0.831504266 23 -0.410878780 24 0.699852841 25 0.279499928 26 0.321592508 27 -0.468042129 28 -0.551210645 29 -0.288122470 30 -0.042235887 31 -0.597646224 32 1.338891639 33 -0.832793482 34 -0.493205688 35 0.016415604 36 1.372659846 37 1.045092890 38 0.405777668 39 0.409575522 40 0.337781309 41 -0.502176595 42 -0.652869971 43 -0.724839219 44 1.334454955 45 -0.666927948 46 -0.505694173 47 -0.568879886 48 0.633149550 49 -0.138539423 50 -0.335489492 51 -1.211066153 52 -0.408020073 53 -0.286003983 54 -1.151593093 55 -0.385536335 56 0.346190882 57 -0.675642471 58 -0.579802732 59 0.149423550 60 1.693915676 61 1.068113286 62 -0.597105714 63 0.438691929 64 -0.048539311 65 -0.217279741 66 -0.287207999 67 0.002621713 68 2.069126079 69 0.394940023 70 0.531107776 71 1.843124762 72 1.864588005 73 1.661908184 74 0.742299342 75 0.715106347 76 0.250627567 77 0.165055653 78 0.272741195 > library(lattice) > postscript(file="/var/www/html/freestat/rcomp/tmp/1w9m81257278300.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/freestat/rcomp/tmp/2rzyg1257278300.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/freestat/rcomp/tmp/3ypeh1257278300.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/freestat/rcomp/tmp/4hb871257278300.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/freestat/rcomp/tmp/5jfh11257278300.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/freestat/rcomp/tmp/6fb581257278300.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/freestat/rcomp/tmp/7vckc1257278300.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/freestat/rcomp/tmp/85so91257278300.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. -11010 -10590 -9883 -9984 -9520 -8895 > > #Note: the /var/www/html/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/9zwkm1257278300.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/freestat/rcomp/tmp/10nfav1257278300.tab") > > system("convert tmp/1w9m81257278300.ps tmp/1w9m81257278300.png") > system("convert tmp/2rzyg1257278300.ps tmp/2rzyg1257278300.png") > system("convert tmp/3ypeh1257278300.ps tmp/3ypeh1257278300.png") > system("convert tmp/4hb871257278300.ps tmp/4hb871257278300.png") > system("convert tmp/5jfh11257278300.ps tmp/5jfh11257278300.png") > system("convert tmp/6fb581257278300.ps tmp/6fb581257278300.png") > system("convert tmp/7vckc1257278300.ps tmp/7vckc1257278300.png") > system("convert tmp/85so91257278300.ps tmp/85so91257278300.png") > > > proc.time() user system elapsed 2.561 1.918 2.939