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(93803,90684,87251,83606,79695,75858,89756,98707,89871,84625,81979,84525,85826,82652,81514,77360,74095,71637,84186,92713,81321,76536,73038,74940,74654,71999,68611,67430,65460,63421,76226,84540,74255,70680,67409,67938,70051,68043,67383,67028,65478,65133,78443,85418,84786,83684,80369,82361,83071,81881,80767,78375,76381,76068,94619,99126,93632,91541,90445,91621,93856,91738,89952,89365,87146,88689,108165,113374,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) > 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/1zvix1229007370.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/2466d1229007370.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.912429369 0.791480656 0.726131693 0.709302822 [6] 0.717387961 0.711725854 0.683262003 0.637767133 0.617063205 [11] 0.635337662 0.705012226 0.737791226 0.631351887 0.498769374 [16] 0.417801566 0.382717870 0.370618943 0.350028245 0.312971502 [21] 0.263906834 0.236417262 0.238993415 0.290315221 0.305775125 [26] 0.202875111 0.080674021 0.006890277 -0.025420023 -0.032372834 [31] -0.046466874 -0.080200260 -0.124851214 -0.148249128 -0.140757939 [36] -0.087357102 -0.069836279 -0.155891150 -0.253861210 -0.311624143 [41] -0.330055549 -0.324423574 -0.326313326 -0.346002270 -0.375768338 [46] -0.386675763 -0.367747030 -0.308054307 -0.280841539 -0.345737612 [51] -0.415412280 -0.448579884 -0.446001045 -0.423492763 -0.405106880 [56] -0.406880100 -0.417498073 -0.413550241 -0.385348187 -0.322201098 [61] -0.287254570 > (mypacf <- c(rpacf$acf)) [1] 0.912429369 -0.245094939 0.321404719 0.119718400 0.176418699 [6] -0.015166554 0.023369630 -0.068786373 0.172221046 0.114956546 [11] 0.408815278 -0.240979301 -0.667115733 0.005402961 -0.089913419 [16] -0.143659690 -0.021507967 -0.037403903 0.092232109 0.038540501 [21] 0.022638223 -0.029489954 0.107386922 -0.029339268 -0.106287561 [26] -0.002259915 -0.014585623 -0.084756948 0.093144199 -0.115786272 [31] -0.070181304 -0.055130971 0.031052482 0.032628077 0.041655674 [36] -0.025698092 0.029160954 0.052693811 -0.082582375 -0.017603846 [41] -0.022709672 -0.079809804 0.057291467 -0.071242152 -0.014351596 [46] 0.015064657 -0.023420038 0.051272836 -0.049273531 0.049818765 [51] 0.065405421 0.018147775 0.001737641 0.060629404 -0.056298925 [56] 0.030242203 -0.079850875 -0.069639042 -0.091759623 0.064696625 > 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/3z4na1229007370.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/4ka0s1229007370.tab") > > system("convert tmp/1zvix1229007370.ps tmp/1zvix1229007370.png") > system("convert tmp/2466d1229007370.ps tmp/2466d1229007370.png") > > > proc.time() user system elapsed 0.825 0.431 1.233