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(831581,808744,899237,929532,883165,908232,955613,937590,849396,978630,868513,1156102,1505713,1415151,1545021,1681193,1457973,1638575,1688972,1563924,1596359,1722061,1549332,2264959,1420268,1415099,1597279,1605693,1575400,1654752,1553966,1570959,1642414,1664774,1551560,2304365,1644081,1425600,1569344,1456489,1610786,1601519,1496600,1486452,1637939,1605759,1504221,1993384,1507620,1477037,1679184,1504731,1570141,1734191,1657498,1652164,1610941,1813765,1711573,2165466,1492778,1385488,1470589,1514657,1641395,1606185,1581162,1517847,1630080,1604623,1548973,2125558) > 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: 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/freestat/rcomp/tmp/1vcyf1244284998.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/freestat/rcomp/tmp/2g22p1244284998.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.62472344 0.57230081 0.55301209 0.43442139 0.42475276 [7] 0.41169451 0.27703988 0.21890171 0.20129561 0.07883026 0.02284547 [13] 0.18655557 -0.05910615 -0.03638646 -0.03924103 -0.08585856 -0.04384885 [19] -0.01504387 -0.07338461 -0.07235119 -0.03849449 -0.08283478 -0.06709005 [25] 0.10644244 -0.11520474 -0.09535673 -0.08426455 -0.11175365 -0.07198035 [31] -0.04813556 -0.08186662 -0.07045138 -0.06142950 -0.08649798 -0.05836767 [37] 0.10573105 -0.03917760 -0.02444248 -0.04590156 -0.06657125 -0.03849934 [43] -0.04483893 -0.08867224 -0.09143433 -0.09196149 -0.13356648 -0.14381482 [49] -0.06704037 > (mypacf <- c(rpacf$acf)) [1] 0.624723444 0.298532518 0.208354766 -0.041944067 0.068134109 [6] 0.076760393 -0.143942243 -0.103236280 0.011128089 -0.123928873 [11] -0.106846873 0.358377197 -0.326896923 0.010722578 -0.002153519 [16] 0.100406495 -0.009533523 0.029853977 0.018193330 -0.066235267 [21] -0.004593085 0.014624155 0.035414242 0.122802526 -0.263555167 [26] -0.107601095 0.036639500 0.057959805 -0.038491297 0.019871730 [31] 0.105085295 -0.017029032 -0.078392570 0.091184166 0.060633782 [36] 0.041598231 -0.048157563 -0.095638343 -0.103811709 -0.043698881 [41] -0.026598709 -0.040685757 -0.005286908 0.002770849 0.007121469 [46] -0.002318233 -0.006552761 -0.096037435 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/html/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/3xedo1244284998.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/freestat/rcomp/tmp/4ey0x1244284998.tab") > > system("convert tmp/1vcyf1244284998.ps tmp/1vcyf1244284998.png") > system("convert tmp/2g22p1244284998.ps tmp/2g22p1244284998.png") > > > proc.time() user system elapsed 0.802 0.416 0.925