R version 2.9.0 (2009-04-17) Copyright (C) 2009 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(921365,987921,1132614,1332224,1418133,1411549,1695920,1636173,1539653,1395314,1127575,1036076,989236,1008380,1207763,1368839,1469798,1498721,1761769,1653214,1599104,1421179,1163995,1037735,1015407,1039210,1258049,1469445,1552346,1549144,1785895,1662335,1629440,1467430,1202209,1076982,1039367,1063449,1335135,1491602,1591972,1641248,1898849,1798580,1762444,1622044,1368955,1262973,1195650,1269530,1479279,1607819,1712466,1721766,1949843,1821326,1757802,1590367,1260647,1149235,1016367,1027885,1262159,1520854,1544144,1564709,1821776,1741365,1623386,1498658,1241822,1136029) > par7 = '0.95' > par6 = 'White Noise' > 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: > 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 (par6 == 'White Noise') par6 <- 'white' else par6 <- 'ma' > par7 <- as.numeric(par7) > 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/1etvh1292330044.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > racf <- acf(x, par1, main='Autocorrelation', xlab='time lag', ylab='ACF', ci.type=par6, ci=par7, sub=paste('(lambda=',par2,', d=',par3,', D=',par4,', CI=', par7, ', CI type=',par6,')',sep='')) > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/2etvh1292330044.ps",horizontal=F,onefile=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.80198925 0.46180251 0.05685111 -0.33530234 -0.59503842 [7] -0.67998036 -0.57506484 -0.30291485 0.08133679 0.43999764 0.67909625 [13] 0.77784870 0.61119685 0.32332605 -0.01164292 -0.32881505 -0.53530806 [19] -0.59469373 -0.49935556 -0.27414750 0.03547405 0.32378720 0.51697562 [25] 0.58877314 0.44791804 0.21200640 -0.05334482 -0.30048194 -0.45797007 [31] -0.50350228 -0.42698803 -0.25398436 -0.01243669 0.21397434 0.35888443 [37] 0.40834915 0.29629314 0.11723928 -0.07132519 -0.25068167 -0.36282408 [43] -0.39080345 -0.32518764 -0.19381278 -0.01545914 0.14018930 0.23186357 [49] 0.25774768 0.17208284 0.04911725 -0.07108848 -0.17795031 -0.23492071 [55] -0.23956076 -0.18448093 -0.09578511 0.01475060 0.10455623 0.14478504 [61] 0.14672475 > (mypacf <- c(rpacf$acf)) [1] 0.801989251 -0.508345051 -0.355595710 -0.313673743 -0.071341180 [6] -0.041094903 0.058861588 0.155988340 0.299959058 0.131125759 [11] 0.089999603 0.252005514 -0.306705420 0.141802292 0.066731119 [16] 0.051647502 -0.013207458 -0.061431141 -0.091371336 -0.071398141 [21] -0.044036439 -0.014448618 0.061943727 -0.026224027 -0.184163367 [26] 0.009950001 0.021747678 0.024445601 0.015753310 -0.042671578 [31] -0.039396063 -0.101700687 -0.040102001 0.003623582 -0.010245792 [36] -0.043664698 -0.108361065 -0.018742907 0.026631913 -0.027517232 [41] 0.021729655 0.021918319 0.010612011 -0.054041787 -0.017016189 [46] -0.050988488 0.004316781 -0.025037034 -0.034336822 0.015170965 [51] -0.022099471 0.013260846 0.029592944 0.018497897 0.028054774 [56] 0.006510671 -0.024295641 0.011277121 -0.011928774 0.002535105 > 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/35zl11292330044.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/4gqk41292330044.tab") > > try(system("convert tmp/1etvh1292330044.ps tmp/1etvh1292330044.png",intern=TRUE)) character(0) > try(system("convert tmp/2etvh1292330044.ps tmp/2etvh1292330044.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.633 0.338 1.428