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. > x <- c(31.88,28.03,27.24,29.14,28.19,28.93,32.28,34.70,33.72,34.26,35.42,34.45,34.16,32.57,28.40,29.15,28.67,28.20,29.25,29.74,26.25,26.81,27.68,27.10,27.04,26.00,25.76,25.93,24.94,21.72,18.16,16.98,16.49,16.52,18.24,16.41,15.71,13.97,12.24,14.75,14.61,15.04,15.50,16.08,15.45,15.14,15.43,15.70,17.57,18.41,17.97,18.39,17.63,17.93,17.80,17.70,18.99,19.83,20.21,20.23,21.10,21.25,21.80,21.83,22.21,22.64,23.53,23.78,23.65,23.92,24.76,26.25,27.68,29.55,29.30,29.25,28.69,26.17,27.09,29.40,30.98,32.96,32.19,31.68,32.49,33.67,32.42,34.38,32.37,30.73,30.33,27.26,25.05,22.25,18.26,18.30) > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '1' > par1 = '60' > #'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: Write here your technical program description (don't use hard returns!) > if (par1 == 'Default') { + par1 = 10*log10(length(x)) + } else { + par1 <- as.numeric(par1) + } > par2 <- as.numeric(par2) > par3 <- as.numeric(par3) > par4 <- as.numeric(par4) > par5 <- as.numeric(par5) > if (par2 == 0) { + x <- log(x) + } else { + x <- (x ^ par2 - 1) / par2 + } > if (par3 > 0) x <- diff(x,lag=1,difference=par3) > if (par4 > 0) x <- diff(x,lag=par5,difference=par4) > postscript(file="/var/www/html/rcomp/tmp/1min81229370754.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > racf <- acf(x,par1,main='Autocorrelation',xlab='lags',ylab='ACF') > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/213i01229370754.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > rpacf <- pacf(x,par1,main='Partial Autocorrelation',xlab='lags',ylab='PACF') > dev.off() null device 1 > (myacf <- c(racf$acf)) [1] 1.000000000 0.959633328 0.910436072 0.863876102 0.806831590 [6] 0.760674839 0.718934775 0.663253292 0.605317490 0.552776063 [11] 0.491544388 0.433401692 0.379742749 0.319894877 0.266896922 [16] 0.226255436 0.173128646 0.111032669 0.041983421 -0.029736073 [21] -0.094389783 -0.142165544 -0.187291961 -0.230162582 -0.270402421 [26] -0.314803835 -0.356474138 -0.392993613 -0.428269512 -0.457647556 [31] -0.478505014 -0.493721182 -0.505022321 -0.514050131 -0.521938733 [36] -0.530494951 -0.527544774 -0.524647981 -0.515341752 -0.499104041 [41] -0.493469956 -0.487600968 -0.479791147 -0.469413356 -0.451085269 [46] -0.425206251 -0.397299200 -0.366400082 -0.335860472 -0.311689014 [51] -0.284119830 -0.251195138 -0.217485094 -0.175811382 -0.136757571 [56] -0.099625651 -0.059093779 -0.023049571 0.004093338 0.033729503 [61] 0.067083390 > (mypacf <- c(rpacf$acf)) [1] 0.9596333280 -0.1322318556 0.0200260345 -0.1686207125 0.1457672243 [6] -0.0227117307 -0.1829143815 -0.0603921958 0.0440169775 -0.1174916024 [11] -0.0093376633 -0.0384697001 -0.0579381560 0.0443164611 0.0774493102 [16] -0.1985649625 -0.1578286776 -0.1781025334 0.0365053784 -0.0139630761 [21] 0.0884619747 -0.0638298714 0.0165478146 -0.0614043200 -0.0321643101 [26] -0.0595299265 -0.0445189892 -0.0385696612 0.0325915600 -0.0319885343 [31] 0.0220731747 -0.0402669445 0.0249348288 0.0189516855 -0.0254544157 [36] 0.0375926602 -0.1324677464 0.0155642484 -0.0003649883 -0.1540667174 [41] 0.0023496323 -0.0518444940 0.0816165574 0.0332242434 0.0016590541 [46] -0.0079616440 -0.0002973014 -0.0730799346 -0.0695159164 0.0262872574 [51] 0.0219423919 0.0544460158 0.0612545441 -0.0971902223 0.0488166848 [56] 0.0665767095 -0.0019491502 -0.1218052579 0.0090615342 0.0171448541 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #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,'Autocorrelation Function',4,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Time lag k',header=TRUE) > a<-table.element(a,hyperlink('http://www.xycoon.com/basics.htm','ACF(k)','click here for more information about the Autocorrelation Function'),header=TRUE) > a<-table.element(a,'T-STAT',header=TRUE) > a<-table.element(a,'P-value',header=TRUE) > a<-table.row.end(a) > for (i in 2:(par1+1)) { + a<-table.row.start(a) + a<-table.element(a,i-1,header=TRUE) + a<-table.element(a,round(myacf[i],6)) + mytstat <- myacf[i]*sqrtn + a<-table.element(a,round(mytstat,4)) + a<-table.element(a,round(1-pt(abs(mytstat),lengthx),6)) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/37igh1229370754.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,'Partial Autocorrelation Function',4,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Time lag k',header=TRUE) > a<-table.element(a,hyperlink('http://www.xycoon.com/basics.htm','PACF(k)','click here for more information about the Partial Autocorrelation Function'),header=TRUE) > a<-table.element(a,'T-STAT',header=TRUE) > a<-table.element(a,'P-value',header=TRUE) > a<-table.row.end(a) > for (i in 1:par1) { + a<-table.row.start(a) + a<-table.element(a,i,header=TRUE) + a<-table.element(a,round(mypacf[i],6)) + mytstat <- mypacf[i]*sqrtn + a<-table.element(a,round(mytstat,4)) + a<-table.element(a,round(1-pt(abs(mytstat),lengthx),6)) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/49bjq1229370754.tab") > > system("convert tmp/1min81229370754.ps tmp/1min81229370754.png") > system("convert tmp/213i01229370754.ps tmp/213i01229370754.png") > > > proc.time() user system elapsed 0.619 0.320 1.174