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(1552,2081,1500,1437,1470,1849,1387,1592,1590,1798,1935,1887,2027,2080,1556,1682,1785,1869,1781,2082,2571,1862,1938,1505,1767,1607,1578,1495,1615,1700,1337,1531,1623,1543,1640,1524,1429,1827,1603,1351,1267,1742,1384,1392,1649,1665,1526,1717,1391,1790,1472,1350,1704,1391,1190,1351,1160,1236,1444,1257,1193,1701,1428,1611,1431,1472,1240,1276,1467,1603,2014,2463,2510) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '1' > par1 = '48' > #'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/1lwtb1289987529.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/2lwtb1289987529.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.51494216 0.34545194 0.24496636 0.16295651 0.03433463 [7] 0.07524003 0.12522581 0.19754500 0.18850857 0.07525969 0.06368946 [13] 0.04326423 -0.07136845 -0.08739241 -0.07277255 -0.11216909 -0.07743616 [19] -0.09309135 -0.02705158 -0.05540691 -0.02351552 -0.08072402 -0.02735202 [25] 0.03965335 0.04143466 -0.00868232 0.02781929 -0.03059888 -0.08604485 [31] -0.08930345 -0.13188383 -0.10426858 -0.08672820 -0.10001188 -0.15311603 [37] -0.10764876 -0.13305978 -0.18659451 -0.15337974 -0.15053987 -0.18084631 [43] -0.16089415 -0.13979334 -0.16665184 -0.18370520 -0.17951707 -0.18367412 [49] -0.06633740 > (mypacf <- c(rpacf$acf)) [1] 0.5149421599 0.1092579429 0.0416668264 -0.0012235127 -0.1045009851 [6] 0.0968196101 0.1013157345 0.1354719690 0.0257452490 -0.1477754069 [11] 0.0098245265 0.0128125865 -0.1042736676 -0.0129347083 -0.0453639717 [16] -0.0938720330 0.0295758937 -0.0556195245 0.0893535046 -0.0581330559 [21] 0.0384820313 -0.0440257018 0.0443716798 0.1479546216 0.0175519396 [26] -0.0829632560 0.0191617192 -0.0994981403 -0.0449107599 -0.0029129111 [31] -0.1314727342 -0.0132632886 -0.0623078379 -0.0377967972 -0.0906753377 [36] -0.0142369058 0.0289592845 -0.1097643321 0.0408994107 -0.0059398314 [41] -0.0719553426 0.0101873648 -0.0009808664 -0.1131428596 -0.0731008881 [46] -0.0568933370 -0.0472913075 0.0870946964 > 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/34rgr1289987529.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/4p9ww1289987529.tab") > > try(system("convert tmp/1lwtb1289987529.ps tmp/1lwtb1289987529.png",intern=TRUE)) character(0) > try(system("convert tmp/2lwtb1289987529.ps tmp/2lwtb1289987529.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.568 0.319 1.331