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.491217355,0.503850111,0.509039441,0.536704225,0.574791423,0.587191169,0.611785216,0.570544558,0.552866603,0.616889289,0.563457407,0.484268459,0.445930128,0.402101833,0.413401419,0.413187983,0.403072614,0.414786234,0.459762651,0.461638714,0.471065341,0.463778706,0.494052946,0.517870215,0.538913087,0.531551814,0.555340925,0.547804259,0.547398738,0.57028626,0.585036825,0.591807104,0.572791649,0.602699138,0.628783976,0.617373204,0.609303575,0.621566676,0.624912384,0.613222117,0.664110905,0.692135811,0.701675951,0.68267419,0.711416337,0.719891159,0.692711638,0.665736869,0.66184245,0.690182116,0.675733321,0.620587875,0.597400689,0.57383352,0.59044317,0.581029636,0.556251947,0.592536616,0.641026011,0.669884956) > x <- c(3.04,3.12,3.21,3.34,3.45,3.74,4.02,4.24,4.87,5.62,6.02,5.98,5.89,5.76,5.58,5.39,5.19,5.16,5.2,5.25,5.26,5.21,5.18,5.13,5.03,5.01,4.87,4.86,4.82,4.69,4.65,4.61,4.47,4.37,4.29,4.2,4.19,4.09,3.88,3.87,3.74,3.61,3.43,3.29,3.18,3.07,3.02,2.97,2.98,3.01,3.06,3.12,3.16,3.19,3.21,3.27,3.36,3.45,3.52,3.58) > 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.151575986 2 -0.134039450 3 -0.123333368 4 -0.087699942 5 -0.042870047 6 -0.012694099 7 0.029063178 8 0.001307914 9 0.022247225 10 0.132242847 11 0.103329865 12 0.021689027 13 -0.022166057 14 -0.073962994 15 -0.073696913 16 -0.085556826 17 -0.107931644 18 -0.098056942 19 -0.050628635 20 -0.045687709 21 -0.035648110 22 -0.045999607 23 -0.017564285 24 0.003188122 25 0.018101269 26 0.009514051 27 0.024721547 28 0.016571909 29 0.013714498 30 0.028633378 31 0.040932053 32 0.045250442 33 0.017653372 34 0.041431136 35 0.062612195 36 0.045684670 37 0.037002069 38 0.043135445 39 0.033608731 40 0.021305492 41 0.064225637 42 0.084281901 43 0.082788536 44 0.055205161 45 0.077204610 46 0.078936735 47 0.048692352 48 0.018652720 49 0.015371274 50 0.045549857 51 0.034165925 52 -0.017301686 53 -0.038036983 54 -0.059765234 55 -0.041929639 56 -0.047665338 57 -0.066926275 58 -0.025124854 59 0.027655349 60 0.060192129 > library(lattice) > postscript(file="/var/www/html/rcomp/tmp/1ebeo1256761177.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/2me2o1256761177.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/3968c1256761177.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/4tgnk1256761177.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/5p5sb1256761177.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/6x8061256761177.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/78soi1256761177.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/86xfc1256761177.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.970 3.285 4.140 4.200 5.055 6.020 > > #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/9d4al1256761177.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/10v8kq1256761177.tab") > > system("convert tmp/1ebeo1256761177.ps tmp/1ebeo1256761177.png") > system("convert tmp/2me2o1256761177.ps tmp/2me2o1256761177.png") > system("convert tmp/3968c1256761177.ps tmp/3968c1256761177.png") > system("convert tmp/4tgnk1256761177.ps tmp/4tgnk1256761177.png") > system("convert tmp/5p5sb1256761177.ps tmp/5p5sb1256761177.png") > system("convert tmp/6x8061256761177.ps tmp/6x8061256761177.png") > system("convert tmp/78soi1256761177.ps tmp/78soi1256761177.png") > system("convert tmp/86xfc1256761177.ps tmp/86xfc1256761177.png") > > > proc.time() user system elapsed 1.600 1.176 2.361