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(569323,579714,577992,565464,547344,554788,562325,560854,555332,543599,536662,542722,593530,610763,612613,611324,594167,595454,590865,589379,584428,573100,567456,569028,620735,628884,628232,612117,595404,597141,593408,590072,579799,574205,572775,572942,619567,625809,619916,587625,565742,557274,560576,548854,531673,525919,511038,498662,555362,564591,541657,527070,509846,514258,516922,507561,492622,490243,469357,477580,528379) > par5 = '12' > par4 = '0' > par3 = '0' > 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/1lvuv1228769300.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/2b94q1228769300.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.884685202 0.697369392 0.544737582 0.458068409 [6] 0.426245725 0.391442262 0.325658286 0.248394745 0.230267342 [11] 0.279360537 0.369795113 0.409641933 0.286528624 0.113610595 [16] -0.026499847 -0.106109275 -0.141203257 -0.176256820 -0.231045644 [21] -0.292194631 -0.291824819 -0.233151929 -0.143092778 -0.091479243 [26] -0.151612539 -0.251269354 -0.322124814 -0.344506122 -0.338560411 [31] -0.334085143 -0.344258093 -0.354509969 -0.318830553 -0.245834142 [36] -0.150126292 -0.083624042 -0.100200739 -0.151414603 -0.178422839 [41] -0.175134813 -0.157505789 -0.142580696 -0.139055718 -0.135779870 [46] -0.102665909 -0.042584042 0.027535224 0.071587589 0.067481316 [51] 0.039183095 0.017786817 0.008324993 0.004731150 0.001854924 [56] -0.008969775 -0.025763782 -0.033703781 -0.025321075 -0.010948109 [61] -0.002039596 > (mypacf <- c(rpacf$acf)) [1] 0.884685202 -0.392480070 0.178755828 0.100651431 0.090279282 [6] -0.114094006 -0.060123660 0.011856588 0.269660064 0.102125377 [11] 0.165920064 -0.215378235 -0.605685608 0.179856245 -0.081922045 [16] -0.049596062 -0.067257290 -0.026434499 0.081960380 -0.008740159 [21] 0.026351085 -0.072706222 -0.050703668 0.034864768 0.028173524 [26] -0.088529091 0.043287259 -0.056031992 0.012758426 0.012629138 [31] -0.009029415 0.049768562 -0.117987631 -0.024628778 0.075571495 [36] -0.025754494 -0.047019831 -0.017422433 0.035822202 -0.045088622 [41] 0.016767303 -0.016203147 -0.008305791 -0.038990867 0.013445456 [46] 0.025599421 -0.093775242 -0.006770671 0.154932571 -0.060545755 [51] -0.129607500 0.021699981 -0.003419065 0.018808928 -0.082121943 [56] -0.097255897 -0.095475369 -0.027054783 0.039403897 0.036463335 > 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/3wmwl1228769300.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/45ln51228769300.tab") > > system("convert tmp/1lvuv1228769300.ps tmp/1lvuv1228769300.png") > system("convert tmp/2b94q1228769300.ps tmp/2b94q1228769300.png") > > > proc.time() user system elapsed 0.814 0.408 0.915