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(1593,1477.9,1733.7,1569.7,1843.7,1950.3,1657.5,1772.1,1568.3,1809.8,1646.7,1808.5,1763.9,1625.5,1538.8,1342.4,1645.1,1619.9,1338.1,1505.5,1529.1,1511.9,1656.7,1694.4,1662.3,1588.7,1483.3,1585.6,1658.9,1584.4,1470.6,1618.7,1407.6,1473.9,1515.3,1485.4,1496.1,1493.5,1298.4,1375.3,1507.9,1455.3,1363.3,1392.8,1348.8,1880.3,1669.2,1543.6,1701.2,1516.5,1466.8,1484.1,1577.2,1684.5,1414.7,1674.5,1598.7,1739.1,1674.6,1671.8,1802,1526.8,1580.9,1634.8,1610.3,1712,1678.8,1708.1,1680.6,2056,1624,2021.4,1861.1,1750.8,1767.5,1710.3,2151.5,2047.9,1915.4,1984.7,1896.5,2170.8,2139.9,2330.5,2121.8,2226.8,1857.9,2155.9,2341.7,2290.2,2006.5,2111.9,1731.3,1762.2,1863.2,1943.5,1975.2) > par5 = '12' > par4 = '0' > 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/freestat/rcomp/tmp/1l1w61229248778.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/freestat/rcomp/tmp/2jt4s1229248778.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.000000e+00 -4.804323e-01 9.524993e-02 -6.434179e-02 -1.081308e-01 [6] 1.109449e-01 -6.037540e-02 1.328471e-01 -2.483129e-02 -7.020904e-02 [11] -9.624307e-02 -5.142042e-02 3.377179e-01 -2.574501e-01 1.725888e-01 [16] -1.705660e-01 1.568236e-02 3.845640e-03 5.097282e-02 -1.304730e-02 [21] 7.737355e-02 -9.039541e-02 -4.724390e-02 1.187207e-02 1.661834e-01 [26] -1.455061e-01 1.615249e-01 -2.323194e-01 6.222439e-02 1.008657e-01 [31] -1.363176e-01 9.020023e-02 6.590811e-02 -1.175103e-01 -5.191107e-03 [36] -6.143381e-02 2.052822e-01 -1.163824e-01 5.152210e-02 -1.315494e-01 [41] 6.792371e-02 2.029664e-02 -7.285151e-02 1.505683e-01 -8.981050e-03 [46] -1.560437e-01 1.183049e-01 -1.532527e-01 1.403647e-01 -1.799440e-02 [51] -3.298499e-02 -2.330362e-02 4.365722e-05 2.510000e-02 -6.158051e-03 [56] 6.610440e-02 -5.011404e-02 -2.010393e-02 1.369691e-02 -1.116953e-01 [61] 2.321489e-01 > (mypacf <- c(rpacf$acf)) [1] -0.480432333 -0.176245428 -0.127721022 -0.250483790 -0.102158587 [6] -0.094628299 0.067847169 0.101264504 -0.002966958 -0.182179869 [11] -0.266545910 0.238651072 0.003047872 0.018733378 -0.113059618 [16] -0.044500607 -0.039386266 0.100022501 -0.119530130 -0.010825825 [21] 0.004717055 0.036209025 -0.036694959 0.119020335 -0.018289049 [26] 0.091408375 -0.083963516 -0.101741210 0.132306359 -0.054182821 [31] -0.100288523 0.029235121 0.053268742 -0.035232074 -0.107699889 [36] 0.052901364 0.049889744 -0.051972347 -0.044865338 -0.093900407 [41] 0.003239146 0.020931015 0.049580277 0.013132764 -0.112608065 [46] 0.092743972 -0.047902788 -0.142042631 -0.053906817 -0.077890587 [51] -0.020783635 -0.074259287 0.020735158 0.042716987 -0.014412383 [56] -0.043517177 -0.022370282 -0.062200218 -0.030807975 0.081324820 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #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,'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/freestat/rcomp/tmp/3ggg71229248778.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/freestat/rcomp/tmp/4cesi1229248778.tab") > > system("convert tmp/1l1w61229248778.ps tmp/1l1w61229248778.png") > system("convert tmp/2jt4s1229248778.ps tmp/2jt4s1229248778.png") > > > proc.time() user system elapsed 0.828 0.422 0.963