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.682223815,4.617197566,4.786908239,4.551347379,4.556609995,4.770345584,4.752382566,4.713486329,4.683611612,4.689235561,4.695467824,4.826952812,4.747624154,4.695833221,4.822215179,4.530985288,4.589244035,4.794798318,4.715995741,4.754451889,4.694736629,4.715368978,4.738739078,4.895448884,4.738564069,4.840163254,4.875197323,4.644390899,4.690246358,4.85577325,4.886129713,4.852342715,4.75660289,4.795211866,4.775672166,4.891100725,4.796203683,4.849057098,4.908528738,4.743888105,4.739176466,4.858648937,4.93375425,4.863217453,4.744584242,4.851874002,4.844423279,4.85787254,4.926601298,4.854916719,4.911919321,4.80557721,4.728095533,4.914124394,4.927253685,4.74701691,4.709079649,4.597440388,4.628789052,4.724463192) > x <- c(4.633757643,4.578826211,4.713127327,4.470495283,4.572646994,4.737075257,4.703203926,4.643428898,4.621043535,4.549657476,4.563305982,4.651099118,4.632785353,4.585987367,4.73532087,4.393213824,4.561218298,4.729156166,4.662495253,4.689511334,4.627909673,4.59511985,4.6121458,4.74927053,4.6121458,4.699570861,4.741447804,4.447346101,4.610157727,4.743191484,4.757891273,4.726502471,4.624972813,4.663439094,4.656813419,4.777441407,4.664382046,4.694096395,4.763881877,4.527208645,4.646312129,4.722953222,4.80729437,4.730039168,4.605170186,4.70682384,4.725616339,4.698660529,4.764734756,4.692264893,4.75272775,4.564348191,4.603168183,4.76046307,4.751000634,4.599152114,4.54648119,4.510859507,4.534747722,4.635699391) > 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.068149739 2 -0.077653836 3 -0.043688524 4 -0.034008127 5 -0.131995740 6 -0.084456639 7 -0.068184082 8 -0.046662483 9 -0.053911110 10 0.023866569 11 0.016303553 12 0.059051296 13 -0.001766654 14 -0.006256346 15 -0.030813791 16 0.023742309 17 -0.087810102 18 -0.051999654 19 -0.063424461 20 -0.052274919 21 -0.049726067 22 0.004048719 23 0.010209776 24 0.028320242 25 0.010034767 26 0.023268741 27 0.015975531 28 0.082433516 29 -0.036273492 30 -0.005210973 31 0.010287623 32 0.008226975 33 0.015108636 34 0.014837673 35 0.001994899 36 -0.004501737 37 0.014876398 38 0.037695922 39 0.026631622 40 0.101209354 41 -0.023886582 42 0.018120614 43 0.007977792 44 0.015526983 45 0.023105568 46 0.027648513 47 0.001203200 48 0.041898148 49 0.043842131 50 0.045406740 51 0.041296281 52 0.125359522 53 0.008640391 54 0.035682850 55 0.058376334 56 0.031621025 57 0.046921100 58 -0.028713410 59 -0.021509850 60 -0.027872991 > library(lattice) > postscript(file="/var/www/html/rcomp/tmp/1fzi51256583703.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/2vz4e1256583703.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/33x9a1256583703.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/4rp6v1256583703.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/5we281256583703.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/67gvf1256583703.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/7nz5h1256583703.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/8ut271256583703.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. 4.393 4.598 4.654 4.651 4.727 4.807 > > #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/9qt3t1256583703.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/101w9z1256583703.tab") > > system("convert tmp/1fzi51256583703.ps tmp/1fzi51256583703.png") > system("convert tmp/2vz4e1256583703.ps tmp/2vz4e1256583703.png") > system("convert tmp/33x9a1256583703.ps tmp/33x9a1256583703.png") > system("convert tmp/4rp6v1256583703.ps tmp/4rp6v1256583703.png") > system("convert tmp/5we281256583703.ps tmp/5we281256583703.png") > system("convert tmp/67gvf1256583703.ps tmp/67gvf1256583703.png") > system("convert tmp/7nz5h1256583703.ps tmp/7nz5h1256583703.png") > system("convert tmp/8ut271256583703.ps tmp/8ut271256583703.png") > > > proc.time() user system elapsed 1.587 1.147 2.725