R version 2.7.0 (2008-04-22) 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(31.58,27.88,27.32,28.89,28.05,28.73,32.00,34.53,33.47,34.09,35.47,34.59,34.32,32.78,28.38,29.18,28.62,28.20,29.33,29.72,26.29,26.82,27.64,27.10,27.05,26.02,25.76,25.94,24.97,21.74,18.16,16.95,16.46,16.44,18.20,16.44,15.70,13.94,12.23,14.75,14.62,15.04,15.50,16.10,15.44,15.14,15.42,15.69,17.57,18.42,17.96,18.39,17.63,17.95,17.79,17.73,18.99,19.83,20.23,20.24,21.12,21.25,21.80,21.84,22.21,22.64,23.54,23.78,23.65,23.93,24.77,26.26,27.69,29.54,29.31,29.26,28.69,26.16,27.12,29.40,30.99,32.96,32.20,31.67,32.49,33.66,32.44,34.38,32.36,30.73,30.31,27.26,25.05,22.33,18.26,18.30,16.00,14.36,14.98,16.88,16.56,13.31,9.61,9.34,7.89,1.71,0.81,0.79) > 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/rcomp/tmp/13nui1229771389.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/2ejny1229771389.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.304555368 0.080122121 0.224398741 0.026381307 [6] 0.032465572 0.083359215 0.013836487 0.116787587 0.147124911 [11] 0.003532320 0.060724199 0.158725970 0.050609450 0.052609311 [16] 0.105525940 0.110168267 0.045706486 -0.058060040 -0.003710312 [21] -0.130215398 -0.107676652 -0.100540866 -0.112309847 -0.030841479 [26] -0.077768774 -0.131304092 -0.039089752 -0.013133813 -0.056363949 [31] -0.042616505 -0.075241514 -0.079644827 -0.057089149 -0.095596301 [36] -0.149175016 -0.034528430 -0.051809188 -0.069024187 0.023979306 [41] -0.068791560 -0.062235403 -0.056919178 -0.150389474 -0.095212264 [46] -0.080012091 -0.063932565 -0.045039772 -0.061683181 -0.124806739 [51] -0.070123358 -0.015245092 -0.087189530 -0.019842016 -0.041862503 [56] -0.080059958 -0.008623736 -0.027497359 -0.034222948 -0.023101082 [61] 0.021874583 > (mypacf <- c(rpacf$acf)) [1] 0.304555368 -0.013923292 0.224787224 -0.122379206 0.071554422 [6] 0.005293990 0.008258635 0.116042880 0.064121702 -0.059034157 [11] 0.041810509 0.106423856 -0.007455903 0.018562480 0.038258422 [16] 0.084675528 -0.055642997 -0.105314863 0.030475997 -0.205584178 [21] 0.001079271 -0.118303121 -0.006967393 -0.037701537 -0.075892480 [26] -0.055827492 0.002469318 0.017511040 0.012446905 -0.003336026 [31] -0.058136036 0.024917222 -0.008271894 0.021323859 -0.083894794 [36] 0.084563802 0.006143267 0.008800917 0.082769328 -0.125138109 [41] 0.042613326 -0.108499434 -0.079148545 -0.048035258 -0.094003851 [46] 0.028659267 -0.059659563 -0.040369642 -0.122031399 0.027934690 [51] -0.007951680 -0.037975830 0.001068148 -0.033507138 -0.043148656 [56] 0.037011137 0.040864656 -0.004601106 0.059130020 0.039602009 > 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/3dbsd1229771389.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/42fik1229771389.tab") > > system("convert tmp/13nui1229771389.ps tmp/13nui1229771389.png") > system("convert tmp/2ejny1229771389.ps tmp/2ejny1229771389.png") > > > proc.time() user system elapsed 1.588 0.579 1.659