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(217859,208679,213188,216234,213587,209465,204045,200237,203666,241476,260307,243324,244460,233575,237217,235243,230354,227184,221678,217142,219452,256446,265845,248624,241114,229245,231805,219277,219313,212610,214771,211142,211457,240048,240636,230580,208795,197922,194596,194581,185686,178106,172608,167302,168053,202300,202388,182516,173476,166444,171297,169701,164182,161914,159612,151001,158114,186530,187069,174330) > par5 = '12' > par4 = '1' > par3 = '1' > par2 = '0.2' > 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/1hpa11228471804.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/2ss7r1228471804.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.2208503074 0.1759676470 -0.1174602694 0.1904179464 [6] 0.0858784583 0.0449172782 0.0820952179 -0.1514982847 0.1900795476 [11] -0.0732687201 0.2606929663 -0.3365054106 0.0827557528 0.0404144643 [16] 0.0734899468 -0.1478579520 -0.0701963746 -0.0058948175 -0.0257994704 [21] 0.0896715025 -0.0294786202 0.0082593069 -0.1163807829 -0.0431618914 [26] -0.0035482531 -0.0707552752 -0.0614218395 0.0146048652 -0.0729908031 [31] -0.0548393962 0.0210447240 -0.0778851265 0.0136204836 -0.0613580343 [36] -0.0371226120 0.0055767853 -0.0439889109 -0.0278393119 -0.0039712343 [41] -0.0002545576 -0.0117241283 0.0144302061 -0.0072967242 -0.0184475745 [46] -0.0020118685 -0.0001085479 > (mypacf <- c(rpacf$acf)) [1] -0.220850307 0.133714704 -0.058084236 0.144410728 0.185382685 [6] 0.051110080 0.101407515 -0.154062054 0.078791557 -0.012561206 [11] 0.177486163 -0.246889233 -0.099540112 0.139134477 0.018334197 [16] -0.185731997 -0.058372017 -0.015623101 0.036887592 0.002578410 [21] 0.109278935 0.041188035 0.003624726 -0.240730852 -0.103933426 [26] -0.006637031 0.014255530 -0.019889454 -0.088030729 -0.028411355 [31] 0.103698354 -0.105256904 0.030151274 0.012117851 -0.039141473 [36] -0.041928835 -0.008023738 0.022594850 0.038620804 -0.044815163 [41] -0.072914497 -0.070848598 0.100083712 -0.011317491 -0.005766942 [46] 0.012160269 > 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/3zqmq1228471804.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/4e5w41228471804.tab") > > system("convert tmp/1hpa11228471804.ps tmp/1hpa11228471804.png") > system("convert tmp/2ss7r1228471804.ps tmp/2ss7r1228471804.png") > > > proc.time() user system elapsed 0.589 0.323 0.696