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(-0.294,0.394,0.486,0.47,0.49,0.494,0.67,0.982,0.87,0.356,-0.472,-0.776,-0.572,0.82,1.27,1.276,0.696,0.206,0.318,0.502,0.64,0.602,0.328,0.228,-0.024,0.708,0.824,0.852,0.632,0.486,0.566,0.714,0.71,0.558,0.484,0.238,-0.004,0.158,0.102,0.098,-0.03,-0.106,-0.09,0.036,0.03,-0.092,0.01,-0.264,-0.762,-0.472,-0.698,-0.97,-0.95,-0.936,-0.74,-0.636,-0.874,-1.146,-1.576,-1.83,-1.458,-0.218,-0.008,-0.436,-0.988,-1.222,-0.86,0.034,0.38,0.41,0.124,-0.284,-0.172) > x <- c(-0.652,-0.818,-0.542,-0.58,-0.74,-0.448,-0.64,-0.754,-1.12,-1.292,-0.586,0.092,-0.246,-0.12,-0.42,-0.632,0.258,-0.022,-0.266,-0.324,0.1,0.786,0.554,0.304,0.508,0.874,0.892,1.026,0.276,0.238,0.498,0.082,-0.18,-1.026,-0.678,-0.586,-0.732,-1.116,-0.954,-1.376,-1.47,-1.118,-0.92,-0.822,-0.73,-0.746,-0.78,-1.202,-1.186,-1.136,-1.464,-0.99,-0.2,0.542,0.68,1.062,1.128,1.962,1.632,2.83,3.336,3.566,3.076,3.062,2.466,1.084,0.76,0.732,0.48,-0.74,-0.718,-1.712,-2.406) > 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.42717533 2 0.22772507 3 0.37475815 4 0.35118113 5 0.33927789 6 0.40150130 7 0.53921742 8 0.82848636 9 0.64350771 10 0.09521173 11 -0.59201524 12 -0.76082528 13 -0.62422087 14 0.79290293 15 1.18308436 16 1.14681258 17 0.74427433 18 0.19844366 19 0.26179123 20 0.43422631 21 0.65676988 22 0.75555500 23 0.43529531 24 0.28544651 25 0.07412313 26 0.87910178 27 0.99869090 28 1.05340986 29 0.68386344 30 0.53028642 31 0.66212918 32 0.72718077 33 0.67093922 34 0.35025086 35 0.34564040 36 0.11798476 37 -0.15312694 38 -0.06769471 39 -0.09139268 40 -0.17953747 41 -0.32628062 42 -0.33209350 43 -0.27661325 44 -0.13107252 45 -0.11872815 46 -0.24391848 47 -0.14869792 48 -0.50684270 49 -1.00165238 50 -0.70168262 51 -0.99308425 52 -1.17057091 53 -0.99304869 54 -0.83109743 55 -0.60758089 56 -0.42741192 57 -0.65225183 58 -0.75795621 59 -1.25375664 60 -1.26888116 61 -0.79598718 62 0.48987372 63 0.60217006 64 0.17137853 65 -0.49946102 66 -1.00902522 67 -0.71162927 68 0.17678766 69 0.47254007 70 0.25927789 71 -0.02233541 72 -0.62853426 73 -0.65491455 > library(lattice) > postscript(file="/var/www/html/rcomp/tmp/1nf6w1261064371.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/2vns41261064371.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/30cr91261064371.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/4jmgp1261064371.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/5ntb11261064371.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/6simt1261064371.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/7zxbh1261064371.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/85hxw1261064371.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. -2.406000 -0.780000 -0.324000 -0.004164 0.554000 3.566000 > > #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/9ucl71261064371.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/10d8hm1261064371.tab") > > try(system("convert tmp/1nf6w1261064371.ps tmp/1nf6w1261064371.png",intern=TRUE)) character(0) > try(system("convert tmp/2vns41261064371.ps tmp/2vns41261064371.png",intern=TRUE)) character(0) > try(system("convert tmp/30cr91261064371.ps tmp/30cr91261064371.png",intern=TRUE)) character(0) > try(system("convert tmp/4jmgp1261064371.ps tmp/4jmgp1261064371.png",intern=TRUE)) character(0) > try(system("convert tmp/5ntb11261064371.ps tmp/5ntb11261064371.png",intern=TRUE)) character(0) > try(system("convert tmp/6simt1261064371.ps tmp/6simt1261064371.png",intern=TRUE)) character(0) > try(system("convert tmp/7zxbh1261064371.ps tmp/7zxbh1261064371.png",intern=TRUE)) character(0) > try(system("convert tmp/85hxw1261064371.ps tmp/85hxw1261064371.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.643 1.192 4.580