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(2236,2084.9,2409.5,2199.3,2203.5,2254.1,1975.8,1742.2,2520.6,2438.1,2126.3,2267.5,2201.1,2128.5,2596,2458.2,2210.5,2621.2,2231.4,2103.6,2685.8,2539.3,2462.4,2693.3,2307.7,2385.9,2737.6,2653.9,2545.4,2848.8,2359.5,2488.3,2861.1,2717.9,2844,2749,2652.9,2660.2,3187.1,2774.1,3158.2,3244.6,2665.5,2820.8,2983.4,3077.4,3024.8,2731.8,3046.2,2834.8,3292.8,2946.1,3196.9,3284.2,3003,2979,3137.4,3630.2,3270.7,2942.3) > par5 = '12' > par4 = '1' > par3 = '1' > par2 = '1' > par1 = '48' > #'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/1yfwo1229088919.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/29jnm1229088919.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.578449874 0.005757300 0.220336806 -0.165153192 [6] 0.015620593 0.161278496 -0.267521587 0.077282564 0.229573838 [11] -0.275122029 0.072241438 0.105864641 -0.239010146 0.230732344 [16] -0.048360086 -0.201953141 0.311996871 -0.169215020 0.014084068 [21] 0.020700751 0.080244157 -0.264469506 0.379835114 -0.247506819 [26] -0.051593274 0.241786974 -0.158080479 0.004555147 0.062411156 [31] -0.126775898 0.108946646 -0.007054518 -0.111345644 0.077100893 [36] 0.035090166 -0.067156821 0.024773107 -0.023359202 -0.007650533 [41] 0.095804918 -0.100446634 0.036733033 0.020379257 -0.007995639 [46] -0.013498622 -0.001411617 > (mypacf <- c(rpacf$acf)) [1] -0.578449874 -0.494212596 -0.120435824 -0.056129884 -0.061373481 [6] 0.165436905 -0.086010323 -0.266473235 0.077041845 0.084252628 [11] -0.026982612 -0.006371211 -0.223827485 -0.108345236 0.002188888 [16] -0.098475377 0.131087061 0.004358750 0.096043209 -0.081284356 [21] 0.165407190 -0.162484469 0.097511454 0.086289079 -0.056317325 [26] -0.027878818 0.087943855 0.127043575 -0.037876069 -0.086272261 [31] 0.014668371 -0.099524439 -0.100780426 -0.014114204 -0.062917885 [36] -0.012098225 -0.047013341 -0.187747081 0.051878620 -0.051801822 [41] 0.055734212 0.014351045 0.026090602 -0.116997735 -0.041765923 [46] -0.051282696 > 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/3kk961229088919.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/4qz5i1229088919.tab") > > system("convert tmp/1yfwo1229088919.ps tmp/1yfwo1229088919.png") > system("convert tmp/29jnm1229088919.ps tmp/29jnm1229088919.png") > > > proc.time() user system elapsed 0.544 0.319 0.683