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.90848501887865 + ,0.886490725172482 + ,0.8750612633917 + ,0.880813592280791 + ,0.89209460269048 + ,0.89209460269048 + ,0.89209460269048 + ,0.8750612633917 + ,0.8750612633917 + ,0.851258348719075 + ,0.8750612633917 + ,0.8750612633917 + ,0.880813592280791 + ,0.886490725172482 + ,0.886490725172482 + ,0.897627091290441 + ,0.90848501887865 + ,0.913813852383717 + ,0.913813852383717 + ,0.913813852383717 + ,0.897627091290441 + ,0.863322860120456 + ,0.838849090737255 + ,0.819543935541869 + ,0.826074802700826 + ,0.838849090737255 + ,0.845098040014257 + ,0.851258348719075 + ,0.857332496431269 + ,0.851258348719075 + ,0.838849090737255 + ,0.845098040014257 + ,0.832508912706236 + ,0.806179973983887 + ,0.826074802700826 + ,0.819543935541869 + ,0.806179973983887 + ,0.799340549453582 + ,0.792391689498254 + ,0.812913356642856 + ,0.832508912706236 + ,0.832508912706236 + ,0.806179973983887 + ,0.785329835010767 + ,0.763427993562937 + ,0.785329835010767 + ,0.857332496431269 + ,0.863322860120456 + ,0.838849090737255 + ,0.785329835010767 + ,0.763427993562937 + ,0.792391689498254 + ,0.851258348719075 + ,0.886490725172482 + ,0.897627091290441 + ,0.886490725172482 + ,0.869231719730976 + ,0.8750612633917 + ,0.903089986991944 + ,0.90848501887865) > x <- c(1.037 + ,1.000 + ,0.963787827345555 + ,0.963787827345555 + ,0.977723605288848 + ,0.982271233039568 + ,0.977723605288848 + ,0.959041392321094 + ,0.949390006644913 + ,0.954242509439325 + ,1.004 + ,1.012 + ,1.008 + ,0.982271233039568 + ,0.963787827345555 + ,0.968482948553935 + ,0.973127853599699 + ,0.973127853599699 + ,0.963787827345555 + ,0.954242509439325 + ,0.954242509439325 + ,0.954242509439325 + ,0.991226075692495 + ,1.0 + ,0.991226075692495 + ,0.968482948553935 + ,0.954242509439325 + ,0.954242509439325 + ,0.959041392321094 + ,0.959041392321094 + ,0.959041392321094 + ,0.963787827345555 + ,0.944482672150169 + ,0.919078092376074 + ,0.924279286061882 + ,0.90848501887865 + ,0.886490725172482 + ,0.897627091290441 + ,0.897627091290441 + ,0.903089986991944 + ,0.897627091290441 + ,0.880813592280791 + ,0.851258348719075 + ,0.832508912706236 + ,0.812913356642856 + ,0.838849090737255 + ,0.913813852383717 + ,0.939519252618618 + ,0.919078092376074 + ,0.897627091290441 + ,0.8750612633917 + ,0.89209460269048 + ,0.919078092376074 + ,0.924279286061882 + ,0.913813852383717 + ,0.886490725172482 + ,0.857332496431269 + ,0.863322860120456 + ,0.90848501887865 + ,0.929418925714293) > 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.0040370251 2 0.0007305617 3 0.0075910172 4 0.0133433461 5 0.0175857226 6 0.0152888227 7 0.0175857226 8 0.0099883300 9 0.0148630180 10 -0.0113907818 11 -0.0127192060 12 -0.0167598180 13 -0.0089871831 14 0.0096849452 15 0.0190204790 16 0.0277854497 17 0.0362973450 18 0.0416261785 19 0.0463436062 20 0.0511647219 21 0.0349779608 22 0.0006737296 23 -0.0424795698 24 -0.0662162279 25 -0.0552538578 26 -0.0309925508 27 -0.0175510905 28 -0.0113907818 29 -0.0077404370 30 -0.0138145847 31 -0.0262238427 32 -0.0223722062 33 -0.0252107534 34 -0.0387084360 35 -0.0214406079 36 -0.0199941620 37 -0.0222493227 38 -0.0347134640 39 -0.0416623240 40 -0.0238998371 41 -0.0015451008 42 0.0069470024 43 -0.0044542775 44 -0.0158345171 45 -0.0278391037 46 -0.0190367920 47 0.0151029304 48 0.0081101006 49 -0.0060393192 50 -0.0487241785 51 -0.0592285507 52 -0.0388679940 53 0.0063699388 54 0.0389753145 55 0.0553975252 56 0.0580614284 57 0.0555295590 58 0.0583335107 59 0.0635518895 60 0.0583736971 > library(lattice) > postscript(file="/var/www/html/rcomp/tmp/1phc51256754308.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/2ug6b1256754308.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/34po01256754308.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/4qv4o1256754308.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/5zt601256754308.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/6270y1256754308.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/71hdf1256754308.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/8nh661256754308.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. 0.8129 0.9017 0.9542 0.9369 0.9685 1.0370 > > #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/9mo821256754308.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/109gch1256754308.tab") > > system("convert tmp/1phc51256754308.ps tmp/1phc51256754308.png") > system("convert tmp/2ug6b1256754308.ps tmp/2ug6b1256754308.png") > system("convert tmp/34po01256754308.ps tmp/34po01256754308.png") > system("convert tmp/4qv4o1256754308.ps tmp/4qv4o1256754308.png") > system("convert tmp/5zt601256754308.ps tmp/5zt601256754308.png") > system("convert tmp/6270y1256754308.ps tmp/6270y1256754308.png") > system("convert tmp/71hdf1256754308.ps tmp/71hdf1256754308.png") > system("convert tmp/8nh661256754308.ps tmp/8nh661256754308.png") > > > proc.time() user system elapsed 1.602 1.162 2.362