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(299.63,305.945,382.252,348.846,335.367,373.617,312.612,312.232,337.161,331.476,350.103,345.127,297.256,295.979,361.007,321.803,354.937,349.432,290.979,349.576,327.625,349.377,336.777,339.134,323.321,318.86,373.583,333.03,408.556,414.646,291.514,348.857,349.368,375.765,364.136,349.53,348.167,332.856,360.551,346.969,392.815,372.02,371.027,342.672,367.343,390.786,343.785,362.6,349.468,340.624,369.536,407.782,392.239,404.824,373.669,344.902,396.7,398.911,366.009,392.484) > 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/freestat/rcomp/tmp/1plrr1228771838.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/2zhwm1228771838.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.0000000000 -0.5548723802 -0.0212451117 0.2168938314 -0.2682376803 [6] 0.2111377517 -0.0729669933 -0.0913596903 0.0541250726 0.1810741173 [11] -0.1521857919 0.0630160069 -0.1625830607 0.0673363997 0.0924565868 [16] -0.0978407215 0.0187145658 0.0161678032 0.0604154079 -0.0623741498 [21] -0.0227740874 0.0471827925 -0.1647731102 0.2515330492 -0.0842848180 [26] -0.1177796980 0.1771361217 -0.1033029629 0.0294953315 -0.0303974455 [31] 0.0107253318 -0.0476972176 0.1359672920 -0.1072626521 0.0038316255 [36] 0.0882765372 -0.1202065767 0.0918449900 -0.0502267928 -0.0084309158 [41] 0.0465577127 -0.0254974597 0.0024073330 0.0047262944 -0.0004143983 [46] -0.0033220819 -0.0009861583 > (mypacf <- c(rpacf$acf)) [1] -0.55487238 -0.47553902 -0.12017062 -0.29768177 -0.09381371 -0.09724810 [7] -0.16706006 -0.32446568 0.10277094 0.17758205 0.33186817 -0.08633471 [13] -0.17975554 -0.24699837 -0.05759414 -0.08523588 -0.03171673 -0.09273661 [19] -0.14270787 -0.21824907 0.21138506 -0.07346477 0.09607166 -0.05687428 [25] -0.04176274 -0.14247321 0.07054080 -0.00117905 -0.05742159 -0.13384913 [31] -0.12617060 -0.09505581 -0.01543616 -0.14315070 0.02085358 -0.03224059 [37] 0.02207756 -0.01023218 0.09812879 0.04320152 -0.04943231 -0.06962631 [43] -0.06179570 -0.16186157 -0.03768623 -0.07380473 > 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/3uu2u1228771838.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/4b0a91228771838.tab") > > system("convert tmp/1plrr1228771838.ps tmp/1plrr1228771838.png") > system("convert tmp/2zhwm1228771838.ps tmp/2zhwm1228771838.png") > > > proc.time() user system elapsed 0.816 0.414 0.915