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(1.407756249,1.380003312,1.308324991,1.422782804,1.457999185,1.403908364,1.433686563,1.407756249,1.422782804,1.5083827,1.45120716,1.411567003,1.51712493,1.419079664,1.415341266,1.490263433,1.493344377,1.490263433,1.499431924,1.461350811,1.484025359,1.542184075,1.499431924,1.487157219,1.539481968,1.440789982,1.461350811,1.534017732,1.49640042,1.555404841,1.557992775,1.534017732,1.525667234,1.617323375,1.505422721,1.550173483,1.557992775,1.484025359,1.499431924,1.547529578,1.565648398,1.568164966,1.519994168,1.547529578,1.534017732,1.592413933,1.534017732,1.573146453,1.580492718,1.563114326,1.525667234,1.563114326,1.628093469,1.608465339,1.570664246,1.632311165,1.603952277,1.632311165,1.658554453,1.617323375,1.67377184,1.644668734,1.590061047,1.662422024,1.654643296,1.573146453,1.531255063,1.511319512,1.49640042,1.536759943,1.487157219,1.471233627,1.542184075) > x <- c(1.454618124,1.440789982,1.298417167,1.480867468,1.493344377,1.437254483,1.433686563,1.422782804,1.447765811,1.528471658,1.484025359,1.45120716,1.528471658,1.467967588,1.396098557,1.525667234,1.528471658,1.514233482,1.493344377,1.471233627,1.490263433,1.560562527,1.525667234,1.5083827,1.547529578,1.480867468,1.440789982,1.563114326,1.522841502,1.560562527,1.531255063,1.51712493,1.525667234,1.608465339,1.5083827,1.568164966,1.578060485,1.519994168,1.477683151,1.570664246,1.580492718,1.582908697,1.511319512,1.555404841,1.547529578,1.615129482,1.547529578,1.578060485,1.601674168,1.573146453,1.522841502,1.578060485,1.632311165,1.599381452,1.528471658,1.603952277,1.61070062,1.615129482,1.648692858,1.612921949,1.666246882,1.636478904,1.539481968,1.644668734,1.634401212,1.525667234,1.484025359,1.471233627,1.484025359,1.522841502,1.490263433,1.477683151,1.539481968) > 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.0362164876 2 -0.0493176422 3 0.0298569493 4 -0.0490027562 5 -0.0270064416 6 -0.0216665077 7 0.0118921260 8 -0.0024849726 9 -0.0139294779 10 -0.0138424804 11 -0.0239243835 12 -0.0287916036 13 -0.0051002504 14 -0.0390376656 15 0.0333736750 16 -0.0289902845 17 -0.0288808034 18 -0.0168755083 19 0.0144262974 20 -0.0002270914 21 0.0022841855 22 -0.0140433905 23 -0.0198217935 24 -0.0137824524 25 -0.0029362720 26 -0.0309955782 27 0.0320298568 28 -0.0249135244 29 -0.0198592575 30 -0.0008226245 31 0.0328184027 32 0.0238151205 33 0.0064135165 34 0.0103398806 35 0.0044830496 36 -0.0141092427 37 -0.0167748727 38 -0.0292173899 39 0.0310203471 40 -0.0194012913 41 -0.0116963529 42 -0.0117396659 43 0.0159427603 44 -0.0032329962 45 -0.0084005080 46 -0.0216306382 47 -0.0084005080 48 -0.0016211947 49 -0.0192951055 50 -0.0064465971 51 0.0094075565 52 -0.0116533217 53 -0.0041561712 54 0.0111067917 55 0.0484390656 56 0.0301095424 57 -0.0053996376 58 0.0182665938 59 0.0089473833 60 0.0056178232 61 0.0055651827 62 0.0080031133 63 0.0561697538 64 0.0170787656 65 0.0201791201 66 0.0538927355 67 0.0561235195 68 0.0497416096 69 0.0212688765 70 0.0205002655 71 0.0054160455 72 0.0028220501 73 0.0082927818 > library(lattice) > postscript(file="/var/www/html/freestat/rcomp/tmp/155cu1256545989.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/2ri3z1256545989.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/36uxn1256545989.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/4unp41256545989.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/595q41256545989.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/6js9i1256545989.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/75j3e1256545989.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/8j8ux1256545989.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. 1.298 1.484 1.526 1.530 1.578 1.666 > > #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/9fjun1256545989.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/10i40e1256545989.tab") > > system("convert tmp/155cu1256545989.ps tmp/155cu1256545989.png") > system("convert tmp/2ri3z1256545989.ps tmp/2ri3z1256545989.png") > system("convert tmp/36uxn1256545989.ps tmp/36uxn1256545989.png") > system("convert tmp/4unp41256545989.ps tmp/4unp41256545989.png") > system("convert tmp/595q41256545989.ps tmp/595q41256545989.png") > system("convert tmp/6js9i1256545989.ps tmp/6js9i1256545989.png") > system("convert tmp/75j3e1256545989.ps tmp/75j3e1256545989.png") > system("convert tmp/8j8ux1256545989.ps tmp/8j8ux1256545989.png") > > > proc.time() user system elapsed 2.561 1.908 3.007