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(106099,103235,98857,101107,102700,101477,99639,96622,94697,95093,112885,121162,113624,111632,106707,108827,108413,106249,104861,102382,100320,100228,117089,121523,114948,112831,107605,108928,101993,102850,99925,101536,99450,98305,110159,109483,106810,96279,91982,90276,90999,86622,83117,80367,77550,77443,92844,92175,84822,81632,78872,81485,80651,78192,76844,76335,71415,73899,86822,86371,83469,82662) > 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/rcomp/tmp/1q9wq1229180022.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/2b9cw1229180022.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.254502322 0.233253964 -0.272329274 0.227261230 [6] 0.038098353 0.052316250 0.151711262 -0.222348387 0.281075484 [11] -0.106264725 0.313861905 -0.372709415 0.098552208 -0.018835117 [16] 0.106724285 -0.133492518 -0.096726833 -0.036273934 -0.050925929 [21] 0.093333908 0.008076255 -0.027828447 -0.140751407 -0.014256400 [26] 0.007227884 -0.102844605 -0.072685742 -0.004636917 -0.015888731 [31] 0.008926338 0.020361591 -0.055275009 -0.041969947 -0.035834595 [36] -0.009494800 0.029806707 -0.037725795 -0.026239115 -0.016928565 [41] 0.001088167 0.002646196 0.022576479 -0.011621587 -0.013371236 [46] -0.013929116 -0.002979317 0.006885970 0.004885347 > (mypacf <- c(rpacf$acf)) [1] -0.254502322 0.180151183 -0.196503270 0.112205386 0.204848202 [6] -0.016695685 0.230446788 -0.179325547 0.171156622 0.095308982 [11] 0.105674123 -0.230245260 -0.135551914 0.135540745 -0.048295749 [16] -0.256083867 -0.052156843 -0.114035300 0.039626999 -0.062738883 [21] 0.145173139 0.082622841 -0.003351895 -0.106667709 -0.011726138 [26] -0.076313651 -0.035342010 -0.079122188 -0.049437110 -0.007596426 [31] 0.106877936 -0.110297411 0.082921864 -0.016007037 -0.074211191 [36] 0.047846524 0.067172319 -0.067425839 -0.027738524 -0.080975928 [41] -0.001067315 -0.082483338 0.020564256 -0.032760187 0.003703868 [46] -0.013880932 0.021353732 0.058921348 > 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/3jr8b1229180022.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/45mmd1229180022.tab") > > system("convert tmp/1q9wq1229180022.ps tmp/1q9wq1229180022.png") > system("convert tmp/2b9cw1229180022.ps tmp/2b9cw1229180022.png") > > > proc.time() user system elapsed 1.544 0.554 1.641