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(10.29454943,10.31450389,10.32626854,10.34161344,10.34280643,10.34810927,10.33970816,10.36246183,10.40774163,10.4372286,10.43193696,10.41577211,10.39973746,10.40268584,10.4943805,10.49440819,10.46908541,10.46860248,10.44531754,10.47302538,10.52023953,10.54733944,10.50862286,10.49252344,10.48116776,10.46635519,10.47630157,10.47033428,10.47160991,10.48893816,10.51006871,10.52642684,10.55934815,10.57072701,10.50251634,10.4618168,10.46170236,10.39451855,10.45711401,10.43933744,10.46917061,10.45941082,10.47160991,10.47568105,10.52158786,10.5028459,10.44787367,10.43022589,10.4453757,10.42356029,10.452389,10.40180528,10.47728798,10.49432511,10.52099482,10.53770711,10.60725316,10.59373052,10.55872516,10.56532465) > x <- c(8.629449874,8.627839712,8.649974303,8.614501374,8.594709634,8.670085938,8.679992082,8.693664335,8.69282576,8.710124927,8.707152175,8.691818542,8.691482577,8.69282576,8.696677393,8.698847859,8.703008637,8.71505996,8.7326271,8.744488114,8.74925684,8.754949455,8.75542238,8.752739509,8.730851904,8.742095196,8.740816628,8.731981938,8.739856627,8.747193184,8.761080104,8.771525284,8.774931387,8.78201597,8.784468454,8.783549477,8.784621535,8.779249716,8.780633799,8.7740036,8.772300418,8.774622221,8.779095811,8.82585367,8.823647949,8.840290669,8.823500728,8.818334284,8.8149246,8.802973457,8.793156871,8.774776816,8.782783017,8.771525284,8.76561455,8.783855897,8.771059915,8.773074951,8.734721004,8.726967775) > 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.078086277 2 -0.056881303 3 -0.062307234 4 -0.019412682 5 -0.002848660 6 -0.056085979 7 -0.072180585 8 -0.060045316 9 -0.014114247 10 0.001937520 11 -0.001045366 12 -0.005301522 13 -0.021075249 14 -0.019170037 15 0.069533296 16 0.067875318 17 0.039321116 18 0.029478662 19 -0.007449600 20 0.011046517 21 0.054557089 22 0.077235894 23 0.038152022 24 0.024136224 25 0.029779306 26 0.006234760 27 0.017174125 28 0.018068198 29 0.013228039 30 0.024858435 31 0.035203864 32 0.043449863 33 0.073725861 34 0.079602559 35 0.009487195 36 -0.030498632 37 -0.031445674 38 -0.094457521 39 -0.032936993 40 -0.045564294 41 -0.014408367 42 -0.025971359 43 -0.017246632 44 -0.049489458 45 -0.001869599 46 -0.033536941 47 -0.075469452 48 -0.089104771 49 -0.071306869 50 -0.083840558 51 -0.047387906 52 -0.083696963 53 -0.014432189 54 0.011348133 55 0.042608348 56 0.045153701 57 0.124637606 58 0.109550011 59 0.104331813 60 0.116952761 > library(lattice) > postscript(file="/var/www/html/rcomp/tmp/1i0w31256765378.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/2btzk1256765378.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/32vo01256765378.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/4pip31256765378.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/5hjmu1256765378.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/62eac1256765378.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/73ttn1256765378.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/8kr9p1256765378.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. 8.595 8.706 8.754 8.744 8.780 8.840 > > #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/974t01256765378.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/10offt1256765378.tab") > > system("convert tmp/1i0w31256765378.ps tmp/1i0w31256765378.png") > system("convert tmp/2btzk1256765378.ps tmp/2btzk1256765378.png") > system("convert tmp/32vo01256765378.ps tmp/32vo01256765378.png") > system("convert tmp/4pip31256765378.ps tmp/4pip31256765378.png") > system("convert tmp/5hjmu1256765378.ps tmp/5hjmu1256765378.png") > system("convert tmp/62eac1256765378.ps tmp/62eac1256765378.png") > system("convert tmp/73ttn1256765378.ps tmp/73ttn1256765378.png") > system("convert tmp/8kr9p1256765378.ps tmp/8kr9p1256765378.png") > > > proc.time() user system elapsed 1.598 1.166 2.687