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 = '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/1nc361229007960.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/26s5g1229007960.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.00000000 0.19232824 -0.31511951 -0.27261938 -0.12627119 0.08587706 [7] 0.08758257 0.08952108 -0.12991121 -0.21628772 -0.28976047 0.22112111 [13] 0.80861345 0.15925290 -0.29078264 -0.24154937 -0.12439226 0.05433291 [19] 0.05971510 0.06341821 -0.10920952 -0.17283738 -0.27393475 0.20593322 [25] 0.70456153 0.11349236 -0.26723989 -0.23514232 -0.13138273 0.03629042 [31] 0.06827678 0.05540708 -0.10837145 -0.17058956 -0.26048125 0.21375045 [37] 0.60310003 0.06824422 -0.22287867 -0.22382768 -0.12242196 0.02896473 [43] 0.05496756 0.05075348 -0.10525552 -0.16647911 -0.23004147 0.19000158 [49] 0.53322626 0.02495755 -0.20250409 -0.19958864 -0.09889036 0.01474710 [55] 0.05929590 0.04332423 -0.07500007 -0.13818541 -0.19909462 0.16719333 [61] 0.43038571 > (mypacf <- c(rpacf$acf)) [1] 0.1923282373 -0.3656345422 -0.1432772172 -0.1771461393 0.0058371910 [6] -0.0791384105 0.0739521505 -0.2030839633 -0.1233626264 -0.4219355536 [11] 0.2803116154 0.6674206199 0.0121711306 0.0710103552 0.1970960323 [16] -0.0589806723 0.0080754627 -0.1164639616 -0.0463603275 -0.0651054742 [21] -0.0007201956 -0.1501100091 -0.0170010641 0.0810853390 -0.0635645942 [26] -0.0258982489 0.0031374694 -0.1003480553 0.0360422313 0.0068632045 [31] 0.0196258174 -0.0680444949 -0.0381568175 -0.0720104412 0.0207156123 [36] -0.1084811886 -0.0490208346 0.0494270392 -0.0174194794 -0.0047273144 [41] 0.0571195766 -0.0902951207 0.0688997879 -0.0747920722 -0.0477497915 [46] -0.0045843512 -0.1025558472 0.0141135996 -0.0789708771 -0.1008957426 [51] 0.0009108886 -0.0187797472 -0.0625792673 0.0319821021 -0.0299628112 [56] 0.0866265567 0.0666465233 0.0690130749 -0.0664875578 -0.0391444182 > 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/39f6o1229007960.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/4bucv1229007960.tab") > > system("convert tmp/1nc361229007960.ps tmp/1nc361229007960.png") > system("convert tmp/26s5g1229007960.ps tmp/26s5g1229007960.png") > > > proc.time() user system elapsed 0.600 0.340 0.887