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(189917,184128,175335,179566,181140,177876,175041,169292,166070,166972,206348,215706,202108,195411,193111,195198,198770,194163,190420,189733,186029,191531,232571,243477,227247,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) > 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/freestat/rcomp/tmp/1ush71229160243.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/2dwd31229160243.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.110079412 0.213416335 -0.178409297 -0.221115280 [6] 0.180312984 -0.110103687 0.230207165 -0.020141673 0.060344641 [11] -0.055899087 -0.071211888 -0.145377678 -0.031187991 0.040631737 [16] -0.112098149 0.207397551 -0.179980915 0.276932433 0.002378605 [21] -0.063130161 0.093024204 -0.194686172 0.174318319 -0.094553314 [26] 0.056268404 0.004948500 -0.032364555 0.001522560 -0.127139438 [31] -0.099769368 -0.088913722 0.080801708 -0.039320108 0.079585553 [36] -0.080566711 -0.040401857 -0.007750556 -0.128742916 0.064103924 [41] -0.074160408 0.107827928 -0.006148204 -0.025834864 -0.022460056 [46] -0.068969757 0.058696176 -0.002201502 > (mypacf <- c(rpacf$acf)) [1] -0.110079412 0.203768012 -0.144976388 -0.310925708 0.242136346 [6] 0.008637139 0.029062510 0.047307402 0.088807474 -0.093892687 [11] -0.015766669 -0.178102135 -0.021100406 0.055601526 -0.210527475 [16] 0.131564328 -0.014600307 0.199202184 0.146108798 -0.111935280 [21] 0.040124432 0.083726572 -0.059340661 -0.112418469 -0.022866744 [26] -0.037803324 -0.004417217 -0.061673544 -0.107634374 -0.050531154 [31] 0.020729982 0.014300824 0.005008394 -0.037257405 0.010726186 [36] -0.024344294 -0.127213575 -0.050848110 -0.035073775 -0.063688700 [41] -0.005279331 -0.045359819 -0.008056020 0.009864875 -0.002350689 [46] 0.052497262 0.082698564 > 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/3awve1229160243.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/4n2811229160243.tab") > > system("convert tmp/1ush71229160243.ps tmp/1ush71229160243.png") > system("convert tmp/2dwd31229160243.ps tmp/2dwd31229160243.png") > > > proc.time() user system elapsed 0.821 0.425 1.054