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.457,0.464,0.470,0.470,0.476,0.476,0.476,0.482,0.489,0.489,0.495,0.495,0.495,0.495,0.495,0.501,0.501,0.501,0.501,0.501,0.507,0.507,0.513,0.519,0.519,0.519,0.519,0.525,0.531,0.531,0.536,0.542,0.548,0.554,0.554,0.560,0.560,0.560,0.565,0.582,0.604,0.610,0.615,0.626,0.626,0.626,0.631,0.631,0.631,0.631,0.637,0.637,0.637,0.642,0.637,0.637,0.637,0.637,0.637,0.637) > x <- c(-1.291,-1.291,-1.291,-1.291,-1.291,-1.273,-1.273,-1.273,-1.273,-1.273,-1.291,-1.273,-1.328,-1.328,-1.328,-1.328,-1.328,-1.328,-1.328,-1.328,-1.328,-1.328,-1.328,-1.309,-1.309,-1.309,-1.291,-1.291,-1.309,-1.291,-1.273,-1.238,-1.221,-1.204,-1.204,-1.204,-1.221,-1.204,-1.204,-1.171,-1.124,-1.079,-1.008,-0.942,-0.942,-0.892,-0.892,-0.904,-0.879,-0.856,-0.844,-0.856,-0.856,-0.892,-0.916,-0.904,-0.916,-0.916,-0.916,-0.916) > 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.052388615 2 -0.045388615 3 -0.039388615 4 -0.039388615 5 -0.033388615 6 -0.039236432 7 -0.039236432 8 -0.033236432 9 -0.026236432 10 -0.026236432 11 -0.014388615 12 -0.020236432 13 -0.002368103 14 -0.002368103 15 -0.002368103 16 0.003631897 17 0.003631897 18 0.003631897 19 0.003631897 20 0.003631897 21 0.009631897 22 0.009631897 23 0.015631897 24 0.015459201 25 0.015459201 26 0.015459201 27 0.009611385 28 0.015611385 29 0.027459201 30 0.021611385 31 0.020763568 32 0.015392814 33 0.015869876 34 0.016346938 35 0.016346938 36 0.022346938 37 0.027869876 38 0.022346938 39 0.027346938 40 0.033625941 41 0.040356642 42 0.031737101 43 0.013670713 44 0.003228719 45 0.003228719 46 -0.013015216 47 -0.008015216 48 -0.004116671 49 -0.012238639 50 -0.019710849 51 -0.017609393 52 -0.013710849 53 -0.013710849 54 0.002984784 55 0.005781873 56 0.001883329 57 0.005781873 58 0.005781873 59 0.005781873 60 0.005781873 > library(lattice) > postscript(file="/var/www/html/rcomp/tmp/1xrni1257181274.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/2oza81257181274.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/36ce41257181274.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/4v3e41257181274.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/5da381257181274.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/6gn101257181274.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/7vaz81257181274.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/86p891257181274.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.3280 -1.2950 -1.2730 -1.1620 -0.9355 -0.8440 > > #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/9vt4c1257181274.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/10efsj1257181275.tab") > > system("convert tmp/1xrni1257181274.ps tmp/1xrni1257181274.png") > system("convert tmp/2oza81257181274.ps tmp/2oza81257181274.png") > system("convert tmp/36ce41257181274.ps tmp/36ce41257181274.png") > system("convert tmp/4v3e41257181274.ps tmp/4v3e41257181274.png") > system("convert tmp/5da381257181274.ps tmp/5da381257181274.png") > system("convert tmp/6gn101257181274.ps tmp/6gn101257181274.png") > system("convert tmp/7vaz81257181274.ps tmp/7vaz81257181274.png") > system("convert tmp/86p891257181274.ps tmp/86p891257181274.png") > > > proc.time() user system elapsed 1.563 1.145 2.655