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(22780,17351,21382,24561,17409,11514,31514,27071,29462,26105,22397,23843,21705,18089,20764,25316,17704,15548,28029,29383,36438,32034,22679,24319,18004,17537,20366,22782,19169,13807,29743,25591,29096,26482,22405,27044,17970,18730,19684,19785,18479,10698,31956,29506,34506,27165,26736,23691,18157,17328,18205,20995,17382,9367,31124,26551,30651,25859,25100,25778,20418,18688,20424,24776,19814,12738,31566,30111,30019,31934,25826,26835) > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '0.4' > 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/16nvt1228763617.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/241ej1228763617.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.2780457450 0.0574932402 -0.0482725739 -0.1512036512 [6] -0.2345946274 -0.4355000609 -0.2349926874 -0.1455258477 -0.0727243195 [11] 0.0174511892 0.2071105966 0.7589640439 0.2285557471 0.0507431927 [16] -0.0523939664 -0.1596805312 -0.2044575487 -0.4004332171 -0.2144019161 [21] -0.1680972039 -0.0982651735 0.0149087141 0.1793551061 0.5941603735 [26] 0.1994839199 0.0420469438 -0.0046005690 -0.0726975784 -0.1470408408 [31] -0.3029517468 -0.1391055981 -0.1455741298 -0.0972316225 0.0059793359 [36] 0.1073782598 0.4314313317 0.1480737175 0.0013209299 -0.0024207103 [41] -0.0287718573 -0.1312829932 -0.1822089098 -0.0954955469 -0.0918799159 [46] -0.0645120003 -0.0001094274 0.0749130048 0.3101279152 0.1130613174 [51] 0.0023094794 0.0248123543 0.0056702342 -0.0706201850 -0.0837178446 [56] -0.0487193940 -0.0200983002 -0.0137176893 -0.0199830685 0.0167193022 [61] 0.1414298633 > (mypacf <- c(rpacf$acf)) [1] 0.278045745 -0.021476535 -0.063571951 -0.130301364 -0.172246379 [6] -0.372466144 -0.085132484 -0.150527631 -0.150126762 -0.142074756 [11] 0.031194880 0.665100556 -0.201233907 -0.063297465 -0.081105443 [16] -0.065614480 0.018222510 -0.039098696 -0.031973293 -0.152304910 [21] -0.065371748 0.006344504 -0.004882671 -0.050688283 -0.066767356 [26] -0.109903073 0.060616159 0.136261173 -0.045747889 0.048695049 [31] 0.024611406 -0.007433693 0.024869261 -0.002433813 -0.135666797 [36] -0.092565897 -0.018564878 -0.076940019 -0.061123995 -0.044294984 [41] -0.147085562 0.105886269 -0.055568235 0.082236631 -0.009102723 [46] -0.027797331 0.043855893 0.017012280 0.063444886 0.033777248 [51] 0.007287303 -0.028352198 0.093633767 -0.009114023 0.008686327 [56] 0.051701931 0.040518857 -0.019742837 -0.072062103 -0.091874374 > 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/3yiec1228763617.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/4x8fl1228763617.tab") > > system("convert tmp/16nvt1228763617.ps tmp/16nvt1228763617.png") > system("convert tmp/241ej1228763617.ps tmp/241ej1228763617.png") > > > proc.time() user system elapsed 0.599 0.325 0.697