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(9.103534368,9.086136769,9.082734247,9.056722883,9.047586121,9.093918909,9.086476385,9.065892468,9.067047202,9.037889935,9.038721338,9.018574356,9.095939112,9.108418382,9.075322160,9.077266018,9.064157862,9.079776002,9.093357016,9.054504940,9.079889943,9.040026434,9.062536177,9.043222649,9.081824950,9.055556158,9.009936308,9.002824077,8.995412975,9.004176841,8.998631198,8.975124239,8.974364842,8.977146485,8.997518370,8.992059976,8.993924141,8.999001866,8.985320061,8.984693690,8.976388622,8.949365142,8.952346543,8.934191535,8.904765847,8.908288886,8.909640602,8.915163618,8.924257021,8.948845729,8.939449862,8.946895524,8.967376693,8.982058643,9.010791270,9.032050676,8.994296558,9.010302809,9.026297334,9.040144995) > x <- c(8.672486076,8.669570872,8.675051276,8.675051276,8.683893367,8.708804795,8.706159291,8.693831965,8.704668113,8.704170560,8.692657961,8.615589513,8.718500048,8.726156679,8.722091302,8.734077193,8.742414583,8.765458532,8.770439087,8.764834214,8.781708986,8.757154528,8.761236807,8.751632702,8.753371421,8.734077193,8.716371865,8.723068501,8.729073550,8.722905701,8.726156679,8.717682052,8.718336502,8.727292029,8.731174901,8.725669706,8.716535733,8.718009331,8.706986763,8.718500048,8.719480761,8.705993714,8.701512751,8.690474004,8.687779492,8.696844520,8.707813551,8.704999678,8.685584843,8.704336438,8.712430973,8.725669706,8.736971085,8.753845093,8.775085935,8.790421307,8.774467601,8.792853289,8.799812470,8.809862805) > 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.101398498 2 0.084780742 3 0.079912163 4 0.053900799 5 0.042398698 6 0.082067454 7 0.075332626 8 0.058046380 9 0.056302347 10 0.027278180 11 0.031189307 12 0.031658830 13 0.081494090 14 0.091925142 15 0.059916445 16 0.058653969 17 0.043315486 18 0.052769162 19 0.065017832 20 0.027665110 21 0.048535960 22 0.015240989 23 0.036658686 24 0.019914343 25 0.058051521 26 0.036944109 27 -0.003939406 28 -0.012843048 29 -0.021860555 30 -0.011446733 31 -0.017862042 32 -0.039101962 33 -0.040036430 34 -0.039650472 35 -0.020317290 36 -0.024302995 37 -0.019995410 38 -0.015311885 39 -0.026045054 40 -0.029751332 41 -0.038318750 42 -0.061734323 43 -0.057554224 44 -0.072756268 45 -0.101461150 46 -0.100363087 47 -0.101945686 48 -0.095669934 49 -0.081382887 50 -0.061810400 51 -0.073371628 52 -0.069467447 53 -0.052009498 54 -0.041841498 55 -0.018790988 56 -0.001633932 57 -0.035120290 58 -0.024032376 59 -0.009899495 60 0.001259611 > library(lattice) > postscript(file="/var/www/html/rcomp/tmp/13re61257123713.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/2vifd1257123713.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/390i21257123713.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/4rlvg1257123713.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/5cdue1257123713.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/6x7xq1257123713.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/7ynxy1257123713.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/8ibr51257123713.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.616 8.705 8.719 8.724 8.745 8.810 > > #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/9iezl1257123713.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/10rbw21257123713.tab") > > system("convert tmp/13re61257123713.ps tmp/13re61257123713.png") > system("convert tmp/2vifd1257123713.ps tmp/2vifd1257123713.png") > system("convert tmp/390i21257123713.ps tmp/390i21257123713.png") > system("convert tmp/4rlvg1257123713.ps tmp/4rlvg1257123713.png") > system("convert tmp/5cdue1257123713.ps tmp/5cdue1257123713.png") > system("convert tmp/6x7xq1257123713.ps tmp/6x7xq1257123713.png") > system("convert tmp/7ynxy1257123713.ps tmp/7ynxy1257123713.png") > system("convert tmp/8ibr51257123713.ps tmp/8ibr51257123713.png") > > > proc.time() user system elapsed 1.607 1.166 10.429