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(1593,1477.9,1733.7,1569.7,1843.7,1950.3,1657.5,1772.1,1568.3,1809.8,1646.7,1808.5,1763.9,1625.5,1538.8,1342.4,1645.1,1619.9,1338.1,1505.5,1529.1,1511.9,1656.7,1694.4,1662.3,1588.7,1483.3,1585.6,1658.9,1584.4,1470.6,1618.7,1407.6,1473.9,1515.3,1485.4,1496.1,1493.5,1298.4,1375.3,1507.9,1455.3,1363.3,1392.8,1348.8,1880.3,1669.2,1543.6,1701.2,1516.5,1466.8,1484.1,1577.2,1684.5,1414.7,1674.5,1598.7,1739.1,1674.6,1671.8,1802,1526.8,1580.9,1634.8,1610.3,1712,1678.8,1708.1,1680.6,2056,1624,2021.4,1861.1,1750.8,1767.5,1710.3,2151.5,2047.9,1915.4,1984.7,1896.5,2170.8,2139.9,2330.5,2121.8,2226.8,1857.9,2155.9,2341.7,2290.2,2006.5,2111.9,1731.3,1762.2,1863.2,1943.5,1975.2) > par5 = '12' > par4 = '1' > par3 = '1' > par2 = '1' > par1 = '36' > #'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/1x4ws1228163507.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/2657j1228163507.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.493897177 0.031986133 0.203133774 -0.229968416 [6] 0.159984526 -0.135549876 0.084664871 -0.033555841 0.004495895 [11] -0.116911650 0.234916115 -0.278560839 0.001965664 0.153832530 [16] -0.084220000 0.067684831 -0.204484857 0.291119946 -0.191339318 [21] 0.016807921 0.138761250 -0.163126439 0.176761027 -0.119528118 [26] 0.026908419 0.106970681 -0.163299830 0.036528815 0.127290757 [31] -0.189616259 0.026883160 0.102033394 -0.078343944 0.001645476 [36] 0.007179043 0.024902636 > (mypacf <- c(rpacf$acf)) [1] -0.493897177 -0.280330563 0.121877248 -0.060848322 0.051393433 [6] -0.125214849 0.025824858 -0.040081085 0.046203346 -0.219586705 [11] 0.185341261 -0.211300603 -0.168315279 -0.130198862 0.200403424 [16] 0.018551563 -0.219511824 0.050705915 0.023991735 -0.006790055 [21] 0.038892729 -0.081686925 0.152681782 0.006364676 -0.139284847 [26] 0.087953808 0.048735665 -0.008050382 -0.106846805 -0.040794581 [31] -0.027233655 0.016270683 0.082678791 -0.117194644 0.076312828 [36] 0.038799297 > 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/3xqgv1228163507.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/4fe0z1228163507.tab") > > system("convert tmp/1x4ws1228163507.ps tmp/1x4ws1228163507.png") > system("convert tmp/2657j1228163507.ps tmp/2657j1228163507.png") > > > proc.time() user system elapsed 0.558 0.327 0.658