R version 2.7.0 (2008-04-22) 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 = '0' > par3 = '1' > par2 = '-0.9' > 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/1tar41228662323.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/2ylge1228662323.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.471631700 0.032569027 0.015290736 -0.140657792 [6] 0.143712959 -0.088033984 0.108823152 -0.019754878 -0.060017343 [11] -0.088336796 -0.047954445 0.357951157 -0.291680772 0.164691541 [16] -0.127985191 -0.048681027 0.060652411 0.052312162 -0.045050898 [21] 0.087154155 -0.073472415 -0.081163207 0.033027030 0.196818687 [26] -0.166015598 0.178297308 -0.257107438 0.039801219 0.163383480 [31] -0.178809823 0.076125410 0.096185024 -0.137261116 -0.008234198 [36] -0.057311789 0.229270307 -0.128658944 0.034087332 -0.109911009 [41] 0.031820256 0.061986084 -0.094359090 0.152544470 -0.003612818 [46] -0.174351392 0.136999051 -0.161489478 0.147253097 -0.017861235 [51] -0.031502281 -0.016667907 -0.014618949 0.038492366 -0.024182501 [56] 0.084796258 -0.053975746 -0.021155772 0.014782427 -0.111694837 [61] 0.221013728 > (mypacf <- c(rpacf$acf)) [1] -0.471631700 -0.244182532 -0.110451283 -0.239936439 -0.066483536 [6] -0.100122763 0.045091787 0.058626272 0.001251776 -0.188177452 [11] -0.279029066 0.243220643 -0.008030559 0.064271252 -0.079618049 [16] -0.080806001 -0.119558197 0.124727692 -0.111747815 0.023089362 [21] 0.030183672 0.008397789 -0.084127753 0.177561969 0.025369932 [26] 0.146305619 -0.093915079 -0.083714636 0.137704184 -0.049705510 [31] -0.111982350 0.002166891 0.047100754 -0.028137481 -0.110218230 [36] 0.057889086 0.044440944 -0.096736383 0.006895335 -0.097279025 [41] -0.042994842 0.001688328 0.077048574 -0.036838439 -0.072129953 [46] 0.076540551 -0.126350200 -0.149055520 -0.051122511 -0.099341217 [51] 0.013878516 -0.022904089 -0.001902455 -0.005572712 0.027105373 [56] -0.025243871 -0.026749434 -0.078568000 0.017788768 0.082913539 > 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/3ij2s1228662323.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/4ysr21228662324.tab") > > system("convert tmp/1tar41228662323.ps tmp/1tar41228662323.png") > system("convert tmp/2ylge1228662323.ps tmp/2ylge1228662323.png") > > > proc.time() user system elapsed 1.537 0.561 1.644