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(95.20,95.00,94.00,92.20,91.00,91.20,103.40,105.00,104.60,103.80,101.80,102.40,103.80,103.40,102.00,101.80,100.20,101.40,113.80,116.00,115.60,113.00,109.40,111.00,112.40,112.20,111.00,108.80,107.40,108.60,118.80,122.20,122.60,122.20,118.80,119.00,118.20,117.80,116.80,114.60,113.40,113.80,124.20,125.80,125.60,122.40,119.00,119.40,118.60,118.00,116.00,114.80,114.60,114.60,124.00,125.20,124.00,117.60,113.20,111.40,112.20,109.80,106.40,105.20,102.20,99.80,111.00,113.00,108.40,105.40,102.00,102.80) > par5 = '12' > par4 = '1' > par3 = '1' > 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/12z3k1229455817.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/24vk01229455817.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.004391449 0.022089036 0.006055648 -0.032179394 [6] -0.056531261 -0.022048172 -0.042612160 0.005348465 0.138156432 [11] -0.180810134 0.022350683 -0.257354491 -0.097088687 0.115847485 [16] 0.010938920 0.020278035 -0.087321466 0.153758131 0.072873745 [21] 0.083578325 -0.017359538 0.005125746 0.121262475 -0.132590283 [26] -0.084429695 -0.213391004 0.066481500 -0.078534017 0.104441919 [31] -0.126135095 -0.081025378 0.057107330 -0.064820980 0.002736061 [36] -0.001350939 0.018843334 0.090822424 0.156791184 -0.127518861 [41] -0.020409053 -0.005899454 -0.115047244 0.075670134 -0.071733517 [46] -0.048214138 0.031574953 -0.012767544 -0.036628072 -0.074480327 [51] -0.039848694 0.030599247 0.083953172 -0.026274421 0.092816055 [56] 0.012171624 0.047757369 -0.001647060 0.002230198 > (mypacf <- c(rpacf$acf)) [1] 0.0043914488 0.0220701767 0.0058668369 -0.0327350347 -0.0566090099 [6] -0.0203388446 -0.0397491113 0.0061463064 0.1375010188 -0.1900044824 [11] 0.0167770536 -0.2719127063 -0.0843394630 0.1426194632 -0.0001186015 [16] 0.0218413559 -0.1751593816 0.1423472414 0.1292817091 0.0564483246 [21] 0.0825040068 -0.1322660091 0.1188631268 -0.1983310654 -0.1079412080 [26] -0.1328756615 0.0151267900 -0.0136992714 0.0102359859 -0.0914177739 [31] -0.0149175352 0.0670541318 0.0196455715 -0.0657914435 0.0859471815 [36] -0.1449967442 0.0510260711 -0.0169223941 -0.1066715767 0.0166275581 [41] -0.1362222673 -0.0959462832 0.0088194114 0.0329878648 0.0505451683 [46] -0.0675127229 0.0284957944 -0.0270815384 -0.0535788616 -0.0419791762 [51] -0.0407479990 -0.0449277397 0.0103335070 -0.0053107997 -0.0129757483 [56] -0.0241726935 -0.0054499409 0.0149650302 > 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/30r0h1229455817.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/4qgat1229455817.tab") > > system("convert tmp/12z3k1229455817.ps tmp/12z3k1229455817.png") > system("convert tmp/24vk01229455817.ps tmp/24vk01229455817.png") > > > proc.time() user system elapsed 0.610 0.308 1.170