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(97.57,97.74,97.92,98.19,98.23,98.41,98.59,98.71,99.14,99.62,100.18,100.66,101.19,101.75,102.2,102.87,98.81,97.6,96.68,95.96,98.89,99.05,99.2,99.11,99.19,99.77,100.70,100.78,100.53,101.01,100.92,101.10,103.11,102.99,102.31,102.61,103.68,104.72,107.66,108.87,108.12,107.61,106.42,105.61,105.71,105.49,105.57,105.18,106.09,106.34,108.47,116.87,121.08,123.27,124.18,125.60,126.57,127.18,128.04,128.55,129.67) > par5 = '12' > par4 = '0' > par3 = '2' > 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/11ciw1229700215.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/2x0x61229700215.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 -2.335468e-01 -1.559314e-01 5.680838e-02 -2.552706e-01 [6] 7.017337e-02 4.008358e-02 8.637055e-02 -1.303177e-01 1.601368e-03 [11] -3.114794e-02 -1.529271e-01 1.836220e-01 6.573405e-02 -1.334532e-02 [16] 3.545220e-02 -7.199231e-02 -4.021515e-02 2.680082e-02 1.361950e-01 [21] -9.323947e-02 -5.732960e-03 -9.361149e-02 -1.003370e-02 6.825451e-02 [26] -5.700849e-03 9.051703e-02 -5.336254e-02 -1.517017e-02 -2.172919e-02 [31] -8.770441e-02 2.769310e-01 -1.160403e-01 4.077380e-02 2.451831e-03 [36] -2.623555e-01 1.044702e-01 1.127682e-02 6.830691e-02 -4.762603e-02 [41] 2.108057e-02 2.041883e-02 -1.018549e-02 3.700091e-02 -3.656152e-02 [46] 2.104205e-03 3.513389e-04 -1.173398e-02 7.813133e-03 -1.126766e-03 [51] 2.649886e-03 -2.485641e-03 2.137342e-03 3.075895e-04 -9.440367e-04 [56] 1.258820e-03 -1.199610e-03 3.168119e-04 -2.489182e-05 > (mypacf <- c(rpacf$acf)) [1] -0.233546813 -0.222618064 -0.044188498 -0.318328514 -0.108066060 [6] -0.111856026 0.064259056 -0.206984268 -0.067881879 -0.166930337 [11] -0.248949113 -0.118571546 -0.047964904 -0.070633690 -0.056259826 [16] -0.085639895 -0.090545752 -0.077125389 0.060173623 -0.079601987 [21] -0.022214930 -0.198166748 -0.016399025 -0.082275126 -0.058008464 [26] -0.037028472 -0.032505513 -0.059970086 -0.049869959 -0.176977937 [31] 0.191724865 -0.088438581 0.145573890 0.024422379 -0.044693475 [36] -0.059779978 0.025065384 -0.034938112 -0.071409740 -0.063677358 [41] 0.046569253 0.102533282 -0.029587607 -0.036927898 -0.047177253 [46] -0.114896431 -0.029325395 -0.023745647 0.005605903 -0.103916612 [51] 0.019659221 -0.071534517 0.075054920 -0.066073274 -0.001623453 [56] -0.071794058 -0.094079138 -0.009879210 > 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/3kp4g1229700215.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/42rdq1229700215.tab") > > system("convert tmp/11ciw1229700215.ps tmp/11ciw1229700215.png") > system("convert tmp/2x0x61229700215.ps tmp/2x0x61229700215.png") > > > proc.time() user system elapsed 0.846 0.446 0.963