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(1202454.6,1201423.4,1505916,1513377.6,1977605.3,1873829.6,1424049.1,1322740,1584825.5,1680460.3,1648573.7,3095468.7,1307982.9,1367588.9,1572718.3,1611602.9,1641196.4,1845262.4,1464237.6,1402385.7,2077099.8,1691129.6,1729012.7,3347792.1,1365087.7,1545460,1844355.1,1775549.8,1721779.2,2128726.1,1664319.9,1769471.4,1904578.4,1872042.3,1802181,3222199.4,1491414.2,1658519.2,2079206.9,1748767.4,2084447.4,2067181.6,1718122.8,1782337.1,1958118.4,2028681.3,2076128.1,3383873,1870369,1654852.9,2074338.3,1888653.7,1991137.8,2168237.9,1867424.1,1842359.6,1927476.3,2065555.4,2455608.5,3336170.9) > 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/1mn9u1228831063.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/291m81228831063.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.4540635330 -0.1144606067 0.2393134801 -0.1808137978 [6] -0.1395115149 0.3372577817 -0.0907035884 -0.1689679047 0.2196015281 [11] -0.1351337458 -0.3921311531 0.7554413214 -0.3402696822 -0.1115631065 [16] 0.2246417045 -0.1546018304 -0.1115846875 0.2682582109 -0.0948331429 [21] -0.0724608272 0.1076406171 -0.0779061137 -0.2663487870 0.4964686176 [26] -0.2017417743 -0.0975460240 0.1731192937 -0.1385368385 -0.0431474149 [31] 0.1507307352 -0.0324648388 -0.0590649537 0.0567446188 -0.0588050874 [36] -0.1463289806 0.2684509425 -0.0840199454 -0.0477060324 0.0652494254 [41] -0.0534163349 -0.0351229893 0.0679346971 0.0173515703 -0.0357536837 [46] 0.0150823866 -0.0355001805 -0.0487949291 0.0600395296 0.0016764832 [51] -0.0008623056 0.0042309544 -0.0151857756 -0.0170578895 0.0018537242 [56] 0.0152488071 0.0027084588 0.0086360950 -0.0012709835 > (mypacf <- c(rpacf$acf)) [1] -0.454063533 -0.403909892 -0.025668125 -0.128846064 -0.328871530 [6] 0.039678263 0.144853788 -0.039721887 0.034187888 -0.020588435 [11] -0.581356955 0.383812001 0.134285026 -0.002657019 -0.099459825 [16] -0.039424313 0.164526520 0.030218135 -0.166527814 0.069312184 [21] -0.152495507 -0.032227294 0.129722256 -0.117586359 0.044594824 [26] 0.015118197 0.007471613 0.018121206 -0.012588984 -0.082405237 [31] 0.111443675 -0.182825242 0.023699695 -0.050560111 -0.011711724 [36] -0.041296987 -0.054360284 0.078880381 -0.025565018 0.020109014 [41] -0.010396210 -0.045717048 -0.041789665 0.025275925 -0.040957481 [46] 0.009508142 -0.021357062 -0.085862516 -0.108952745 -0.011184046 [51] 0.078888148 -0.032549445 -0.117041306 -0.032918645 -0.101171859 [56] -0.034576650 0.053883713 0.007683821 > 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/3c01q1228831063.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/4x1v11228831063.tab") > > system("convert tmp/1mn9u1228831063.ps tmp/1mn9u1228831063.png") > system("convert tmp/291m81228831063.ps tmp/291m81228831063.png") > > > proc.time() user system elapsed 0.570 0.304 0.988