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.034283041,-0.057660003,-0.105996947,-0.208621088,-0.220404198,-0.139474505,-0.104664416,-0.039026785,-0.104663312,-0.021180889,-0.032833113,-0.013625501,-0.101489299,-0.13145901,-0.156198341,-0.19270995,-0.155507653,-0.126748865,-0.103485538,-0.134593206,-0.107595864,-0.097242772,0.025542545,-0.000339608,-0.038608451,-0.030397529,-0.086146589,-0.141688487,-0.073334743,0.009073611,0.03694428,0.077657082,0.0338156,0.062967047,0.178426251,0.253705275,0.230301784,0.167617064,0.102643593,-0.00366903,-0.035648469,-0.066270404,-0.068986516,-0.044020567,-0.020446172,0.057529055,0.099280321,0.134155403,0.089399272,0.133251135,0.096780647,-0.001781812,0.028527049,0.092153397,0.126208459,0.1625611,0.154490341,0.176210215,0.222227014,0.249335133) > x <- c(-3388.23981,-5872.093864,-14052.1039,-19203.67533,-24044.19734,-17742.28074,27744.2042,35762.75709,41087.62968,28606.60883,14902.64899,7759.622726,-3776.912419,-4660.673037,-12883.9742,-20576.76724,-22040.6962,-16004.18577,22072.46441,30238.48835,42118.537,25185.47985,13947.85282,3560.533899,-11669.24371,-13718.99352,-20008.89931,-27883.93174,-25118.66378,-17956.14486,18059.81884,22967.25744,33919.10764,20740.30456,12154.69761,3791.18023,-6213.536375,-15069.58657,-19399.72402,-29503.72248,-28984.08773,-23813.80819,12029.47675,23039.86053,23629.98332,14123.87136,2928.628123,-2532.706238,-9237.265317,-9872.185775,-19113.70932,-23364.3765,-28379.75488,-27061.33248,7441.018864,20404.86134,17037.67756,7876.769459,-2041.972623,-7941.89618) > 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.032439054 2 -0.054464225 3 -0.098349351 4 -0.198169845 5 -0.207318591 6 -0.129818599 7 -0.119763683 8 -0.058490001 9 -0.127024491 10 -0.036749504 11 -0.040943603 12 -0.017848531 13 -0.099433785 14 -0.128922525 15 -0.149186478 16 -0.181511427 17 -0.143512414 18 -0.118038884 19 -0.115498066 20 -0.151049941 21 -0.130518095 22 -0.110949501 23 0.017951685 24 -0.002277362 25 -0.032257682 26 -0.022931222 27 -0.075257118 28 -0.126513176 29 -0.059664377 30 0.018845909 31 0.027115559 32 0.065157579 33 0.015355756 34 0.051679522 35 0.171811283 36 0.251641996 37 0.233683386 38 0.175818406 39 0.113201532 40 0.012387822 41 -0.019874418 42 -0.053310182 43 -0.075533335 44 -0.056559583 45 -0.033306351 46 0.049842401 47 0.097686470 48 0.135533781 49 0.094426482 50 0.138623889 51 0.107182928 52 0.010933816 53 0.043972203 54 0.106881024 55 0.122158823 56 0.151456134 57 0.145217902 58 0.171923430 59 0.223338320 60 0.253657362 > library(lattice) > postscript(file="/var/www/html/rcomp/tmp/1e3bb1256732863.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/23zhq1256732863.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/3e21t1256732863.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/4j1j11256732863.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/50l2l1256732863.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/6vaqx1256732863.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/7hfot1256732863.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/8a7pz1256732863.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. -2.950e+04 -1.825e+04 -3.583e+03 3.833e-07 1.729e+04 4.212e+04 > > #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/9ws2c1256732863.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/10mukb1256732863.tab") > > system("convert tmp/1e3bb1256732863.ps tmp/1e3bb1256732863.png") > system("convert tmp/23zhq1256732863.ps tmp/23zhq1256732863.png") > system("convert tmp/3e21t1256732863.ps tmp/3e21t1256732863.png") > system("convert tmp/4j1j11256732863.ps tmp/4j1j11256732863.png") > system("convert tmp/50l2l1256732863.ps tmp/50l2l1256732863.png") > system("convert tmp/6vaqx1256732863.ps tmp/6vaqx1256732863.png") > system("convert tmp/7hfot1256732863.ps tmp/7hfot1256732863.png") > system("convert tmp/8a7pz1256732863.ps tmp/8a7pz1256732863.png") > > > proc.time() user system elapsed 1.542 1.127 2.035