R version 2.8.0 (2008-10-20) Copyright (C) 2008 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.6348,0.634,0.62915,0.62168,0.61328,0.6089,0.60857,0.62672,0.62291,0.62393,0.61838,0.62012,0.61659,0.6116,0.61573,0.61407,0.62823,0.64405,0.6387,0.63633,0.63059,0.62994,0.63709,0.64217,0.65711,0.66977,0.68255,0.68902,0.71322,0.70224,0.70045,0.69919,0.69693,0.69763,0.69278,0.70196,0.69215,0.6769,0.67124,0.66532,0.67157,0.66428,0.66576,0.66942,0.6813,0.69144,0.69862,0.695,0.69867,0.68968,0.69233,0.68293,0.68399,0.66895,0.68756,0.68527,0.6776,0.68137,0.67933,0.67922) > x <- c(0.424679327,0.429051418,0.428856061,0.424417701,0.427487492,0.420353721,0.414424849,0.415019321,0.399648223,0.391569003,0.382742221,0.388590191,0.388318949,0.39035147,0.383764681,0.382401169,0.376516786,0.386689953,0.380078922,0.380899154,0.381786981,0.381855242,0.383423977,0.383832808,0.379873758,0.383492127,0.384922207,0.403062223,0.415745418,0.432496447,0.436705344,0.431782416,0.436576103,0.43728672,0.44404459,0.441089619,0.448333008,0.453238883,0.449162963,0.441282601,0.431782416,0.418183881,0.423305026,0.430937904,0.43379338,0.433469305,0.419762413,0.429442017,0.436252928,0.438319445,0.437867759,0.436640726,0.434894452,0.43119783,0.44327457,0.440059753,0.437996833,0.437609561,0.434959183,0.436899174) > 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.0325232289 2 -0.0370209284 3 -0.0417057051 4 -0.0454219585 5 -0.0564182367 6 -0.0547648441 7 -0.0500804959 8 -0.0324332710 9 -0.0232431525 10 -0.0153901456 11 -0.0134748876 12 -0.0166808130 13 -0.0199814098 14 -0.0266904161 15 -0.0169896340 16 -0.0174964426 17 0.0016402791 18 0.0088563148 19 0.0090975997 20 0.0060338878 21 -0.0004569926 22 -0.0011647244 23 0.0046585167 24 0.0093927475 25 0.0276811173 26 0.0372808788 27 0.0488513875 28 0.0399794543 29 0.0534526318 30 0.0283054355 31 0.0229557575 32 0.0258593278 33 0.0195450632 34 0.0196440583 35 0.0090785843 36 0.0207577534 37 0.0048216513 38 -0.0145774965 39 -0.0167902838 40 -0.0160454613 41 -0.0017606722 42 0.0024502998 43 -0.0004009127 44 -0.0031964255 45 0.0062685534 46 0.0166826401 47 0.0354552551 48 0.0236487222 49 0.0215583887 50 0.0108206303 51 0.0138526441 52 0.0054904082 53 0.0080273209 54 -0.0038862581 55 0.0045098293 56 0.0049387634 57 -0.0009865204 58 0.0031110152 59 0.0033125746 60 0.0015618256 > library(lattice) > postscript(file="/var/www/html/freestat/rcomp/tmp/19edy1256680651.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/freestat/rcomp/tmp/2svko1256680651.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/freestat/rcomp/tmp/3mugj1256680651.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/freestat/rcomp/tmp/4sgqm1256680652.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/freestat/rcomp/tmp/58k751256680652.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/freestat/rcomp/tmp/612v81256680652.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/freestat/rcomp/tmp/7noqn1256680652.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/freestat/rcomp/tmp/836021256680652.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.3765 0.3885 0.4282 0.4172 0.4367 0.4532 > > #Note: the /var/www/html/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/9zxgk1256680652.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/freestat/rcomp/tmp/10c0tr1256680652.tab") > > system("convert tmp/19edy1256680651.ps tmp/19edy1256680651.png") > system("convert tmp/2svko1256680651.ps tmp/2svko1256680651.png") > system("convert tmp/3mugj1256680651.ps tmp/3mugj1256680651.png") > system("convert tmp/4sgqm1256680652.ps tmp/4sgqm1256680652.png") > system("convert tmp/58k751256680652.ps tmp/58k751256680652.png") > system("convert tmp/612v81256680652.ps tmp/612v81256680652.png") > system("convert tmp/7noqn1256680652.ps tmp/7noqn1256680652.png") > system("convert tmp/836021256680652.ps tmp/836021256680652.png") > > > proc.time() user system elapsed 2.556 1.917 2.893