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(100,87.14054095,112.0054296,112.312101,109.474134,104.9746116,100.4926851,104.2154743,120.1768388,112.1028355,108.1481575,116.802197,102.1699512,95.15358705,120.6707808,111.5234277,119.9669448,113.3697401,110.0717661,111.5567342,132.424212,107.900558,122.1626615,124.3992258,110.4450505,101.5874013,122.3203962,125.2582826,125.4411543,108.9902468,118.9243879,116.7242723,134.1724901,116.8530994,124.5732995,130.9914031,123.4239103,111.4536725,124.5135991,139.2589613,129.8596099,112.3460359,131.381655,133.0004776,134.3220552,144.2379719,134.1278719,150.1891559,140.722563,114.8389975,143.1973003,140.2738676,112.1248303,102.8951536,100.5090242,103.3513901,111.4134533,104.5887587,101.7840983,114.7007441,108.7426474) > x <- c(100,99.31916948,114.7106298,114.9941367,114.6085397,116.3633855,108.0492516,112.8502449,127.2518452,116.4999655,113.8511416,126.3771815,103.8290681,108.296889,125.0969166,115.6701386,130.2545354,131.2064565,124.8665241,122.6191626,148.2368766,117.7160792,128.9232255,130.7380837,113.1192661,116.5454922,127.9782024,132.9240533,133.9732358,121.2623301,128.559702,124.692695,140.9850314,124.6823481,134.9451611,137.2642616,132.6308891,122.7122853,132.5846727,151.5410085,145.764641,134.4043595,152.9192247,143.9387459,152.9709595,162.3356557,148.1658274,167.9499207,156.9400566,140.2241843,163.13996,160.969166,135.3031662,124.4554046,119.2143202,116.21163,125.2638477,114.0987791,110.0413879,126.6317169,113.0875354) > 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 4.8857105 2 -7.4421425 3 5.4047869 4 5.4900904 5 2.9532053 6 -2.9165357 7 -0.9066206 8 -0.9325428 9 3.7837649 10 4.1050438 11 2.2186203 12 1.0920779 13 4.0658490 14 -6.4390789 15 5.9603181 16 4.1735814 17 1.2293104 18 -6.1111732 19 -4.4588015 20 -1.2190487 21 -0.3543932 22 -1.0467996 23 4.4645405 24 5.2840273 25 5.0869763 26 -6.4459386 27 5.3601681 28 4.4362354 29 3.7998845 30 -2.7260942 31 1.5101133 32 2.3294339 33 7.0562704 34 2.4663401 35 2.1731310 36 6.7804347 37 2.8307716 38 -1.3948225 39 3.9565471 40 3.9004240 41 -0.9886244 42 -9.6318639 43 -5.0530210 44 3.5779387 45 -2.1530163 46 0.4507587 47 1.4047434 48 2.0182126 49 1.1483412 50 -11.6831376 51 -1.2179297 52 -2.4463632 53 -10.5548757 54 -11.3144037 55 -9.6081898 56 -4.4212635 57 -3.4273525 58 -1.5341388 59 -1.1707072 60 -1.2081213 61 3.4093492 > library(lattice) > postscript(file="/var/www/html/rcomp/tmp/1lhzp1257950416.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/235hs1257950416.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/3inh31257950416.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/4xr341257950416.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/5mzj41257950416.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/69nbw1257950416.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/7u0g91257950416.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/8va2f1257950416.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. 99.32 116.20 126.40 128.60 135.30 167.90 > > #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/9fl0w1257950416.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/10qams1257950416.tab") > system("convert tmp/1lhzp1257950416.ps tmp/1lhzp1257950416.png") > system("convert tmp/235hs1257950416.ps tmp/235hs1257950416.png") > system("convert tmp/3inh31257950416.ps tmp/3inh31257950416.png") > system("convert tmp/4xr341257950416.ps tmp/4xr341257950416.png") > system("convert tmp/5mzj41257950416.ps tmp/5mzj41257950416.png") > system("convert tmp/69nbw1257950416.ps tmp/69nbw1257950416.png") > system("convert tmp/7u0g91257950416.ps tmp/7u0g91257950416.png") > system("convert tmp/8va2f1257950416.ps tmp/8va2f1257950416.png") > > > proc.time() user system elapsed 1.635 1.211 2.106