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(4.640826863,4.640923356,4.641116313,4.642176912,4.643236387,4.64352514,4.64352514,4.643621372,4.644871553,4.646599996,4.647271362,4.647367235,4.647367235,4.647654798,4.649665426,4.650621449,4.65138561,4.651576559,4.651576559,4.65167202,4.653388758,4.656718448,4.657572865,4.658047226,4.658047226,4.657952371,4.658900508,4.660510281,4.66079409,4.660983251,4.660983251,4.660983251,4.662967285,4.665041583,4.666641508,4.666923582,4.666923582,4.666829566,4.667581446,4.666171208,4.665606555,4.665606555,4.665606555,4.665606555,4.666641508,4.667581446,4.667581446,4.667957174,4.668144985,4.668802046,4.667205577,4.666923582,4.665794808,4.665418266,4.665418266,4.665700686,4.665229942,4.664193526,4.664664758,4.66428779) > x <- c(4.608165695,4.590056548,4.55492897,4.533674184,4.523960131,4.48863637,4.458987676,4.436751534,4.415219602,4.391976966,4.404277244,4.404277244,4.417635062,4.428433007,4.456670178,4.455509411,4.456670178,4.48638665,4.49535532,4.475061501,4.480740108,4.484131858,4.510859507,4.516338972,4.558078578,4.592084946,4.604169686,4.591071262,4.608165695,4.607168189,4.609162207,4.619073091,4.634728988,4.692264893,4.713127327,4.737075257,4.802380355,4.848900371,4.866764924,4.852030264,4.816241156,4.820281566,4.847331743,4.848900371,4.855150391,4.878246106,4.906015245,4.8978398,4.973279508,4.992471323,5.016617366,5.001930853,4.951592753,4.93375425,4.94021283,4.980863136,4.99653637,5.000584958,5.017941869,5.059425458) > 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.0144837816 2 -0.0137421584 3 -0.0122977973 4 -0.0104800061 5 -0.0090744724 6 -0.0075273264 7 -0.0064711050 8 -0.0055827205 9 -0.0035654742 10 -0.0010090228 11 -0.0007758486 12 -0.0006799756 13 -0.0011558418 14 -0.0012529507 15 -0.0002482592 16 0.0007491156 17 0.0014719248 18 0.0006042379 19 0.0002847331 20 0.0011031522 21 0.0026175924 22 0.0058264528 23 0.0057287094 24 0.0060078670 25 0.0045209124 26 0.0032145959 27 0.0037322194 28 0.0058086179 29 0.0054834454 30 0.0057081421 31 0.0056371061 32 0.0052840354 33 0.0067103351 34 0.0067349425 35 0.0075916527 36 0.0070205925 37 0.0046941279 38 0.0029428573 39 0.0030583207 40 0.0021729983 41 0.0028833161 42 0.0027393783 43 0.0017757280 44 0.0017198463 45 0.0025321452 46 0.0026493088 47 0.0016600458 48 0.0023270203 49 -0.0001726742 50 -0.0001993130 51 -0.0026559738 52 -0.0024147684 53 -0.0017502704 54 -0.0014913238 55 -0.0017214078 56 -0.0028871365 57 -0.0039162324 58 -0.0050968775 59 -0.0052439777 60 -0.0070987798 > library(lattice) > postscript(file="/var/www/html/freestat/rcomp/tmp/18eza1256299273.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/2dnb31256299273.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/32tgp1256299273.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/4a0191256299273.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/5wzan1256299273.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/6oxk21256299273.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/74o6u1256299273.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/815vj1256299273.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.392 4.488 4.609 4.686 4.870 5.059 > > #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/9ixxu1256299273.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/108owb1256299273.tab") > > system("convert tmp/18eza1256299273.ps tmp/18eza1256299273.png") > system("convert tmp/2dnb31256299273.ps tmp/2dnb31256299273.png") > system("convert tmp/32tgp1256299273.ps tmp/32tgp1256299273.png") > system("convert tmp/4a0191256299273.ps tmp/4a0191256299273.png") > system("convert tmp/5wzan1256299273.ps tmp/5wzan1256299273.png") > system("convert tmp/6oxk21256299273.ps tmp/6oxk21256299273.png") > system("convert tmp/74o6u1256299273.ps tmp/74o6u1256299273.png") > system("convert tmp/815vj1256299273.ps tmp/815vj1256299273.png") > > > proc.time() user system elapsed 2.634 1.964 3.428