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) > par7 = '0.95' > par6 = 'MA' > 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: > 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/13gn31261311660.ps",horizontal=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/20zy41261311660.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.132946235 0.126556373 0.172837937 0.017071725 [6] 0.056487715 0.119522804 -0.047873837 0.107307335 -0.158912677 [11] -0.017280229 0.066853766 -0.224801811 -0.138311499 -0.016553677 [16] -0.113916314 0.027078192 -0.108759949 0.035185151 -0.029505055 [21] -0.065017859 0.100751950 -0.018596759 -0.076755345 0.053736345 [26] -0.037077925 -0.072968097 0.093323248 -0.088298042 0.104267428 [31] -0.101770643 -0.087127052 0.037963783 -0.029710571 -0.139689923 [36] 0.184128907 -0.118439163 0.033313927 -0.010558578 0.012492297 [41] 0.017667260 -0.054440652 -0.018670612 0.042460133 -0.062828371 [46] 0.060464598 0.001340000 > (mypacf <- c(rpacf$acf)) [1] -0.1329462345 0.1108407490 0.2087427567 0.0561467938 0.0184162019 [6] 0.0908956462 -0.0431166899 0.0554369530 -0.1816015009 -0.0876602050 [11] 0.0659115606 -0.1681920248 -0.2089745227 -0.0499294512 0.0311281692 [16] 0.1014283624 -0.0455380136 0.0751651101 0.0303495833 -0.0007495903 [21] 0.0629734186 -0.0690435941 -0.0842654209 -0.0494989000 -0.0798753749 [26] -0.1714820505 0.0326815106 0.0049500516 0.1189846049 -0.0448849765 [31] -0.0912434636 -0.0083536526 0.0710255096 -0.1137089778 0.0745360553 [36] -0.0320804079 0.0024059037 -0.0780816995 -0.0274308021 0.0038913016 [41] -0.0427008384 -0.0114432878 -0.1045574399 -0.0201328711 0.0499331670 [46] 0.0082596794 > 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/3bjme1261311660.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/44fdx1261311660.tab") > > try(system("convert tmp/13gn31261311660.ps tmp/13gn31261311660.png",intern=TRUE)) character(0) > try(system("convert tmp/20zy41261311660.ps tmp/20zy41261311660.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.598 0.322 0.787