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(565464,547344,554788,562325,560854,555332,543599,536662,542722,593530,610763,612613,611324,594167,595454,590865,589379,584428,573100,567456,569028,620735,628884,628232,612117,595404,597141,593408,590072,579799,574205,572775,572942,619567,625809,619916,587625,565742,557274,560576,548854,531673,525919,511038,498662,555362,564591,541657,527070,509846,514258,516922,507561,492622,490243,469357,477580,528379,533590,517945) > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '1.0' > 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/1qrk81228469276.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/2xkvm1228469276.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.884026819 0.725621268 0.607182674 0.520334340 [6] 0.478928153 0.441292997 0.371435599 0.297264154 0.284460054 [11] 0.321310538 0.385510891 0.403888837 0.274117063 0.129858106 [16] 0.018737657 -0.067446033 -0.109251053 -0.150122456 -0.212563683 [21] -0.273635942 -0.273111787 -0.235411199 -0.179432241 -0.152347788 [26] -0.211896341 -0.288028835 -0.333051896 -0.354841196 -0.351211372 [31] -0.351072258 -0.364835534 -0.376631560 -0.343331858 -0.285130327 [36] -0.215351734 -0.163261674 -0.173554459 -0.195685585 -0.191056122 [41] -0.186820361 -0.174093017 -0.161877042 -0.156661921 -0.151053423 [46] -0.115263420 -0.067398133 -0.018270053 0.022813284 0.030286356 [51] 0.033381945 0.042197939 0.034817385 0.026533103 0.021660196 [56] 0.012871829 0.004318405 0.006589296 0.005807996 -0.001546579 > (mypacf <- c(rpacf$acf)) [1] 0.8840268195 -0.2557575463 0.1358937676 0.0004953652 0.1565486292 [6] -0.0714212841 -0.1099826999 0.0038269011 0.2520544718 0.1100765728 [11] 0.1452547633 -0.1853251791 -0.5708562348 0.0996439407 -0.1200985561 [16] -0.0334379072 0.0245210069 -0.0482167552 0.0805789472 -0.0570916108 [21] -0.0196145159 -0.1098696074 0.0248427602 0.0359710701 0.0551695106 [26] -0.1305616409 0.1042917840 -0.0342758142 -0.0361816551 -0.0126626334 [31] -0.0289121913 0.0239754441 -0.0118760028 -0.0265203066 0.0096104101 [36] 0.0222331429 -0.0528698050 0.0461955396 -0.0227883352 -0.1218886874 [41] 0.0432065514 -0.0576188362 0.0885116586 -0.0329186903 -0.0003765158 [46] -0.0490703479 0.0055545652 -0.0046855260 0.0668739299 -0.0250669614 [51] -0.0484253097 0.0049688718 -0.0771129386 0.0399802065 -0.0692783064 [56] -0.0185958470 -0.0697724853 -0.0623799297 -0.0709988088 > 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/34ltl1228469276.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/4bjtc1228469276.tab") > > system("convert tmp/1qrk81228469276.ps tmp/1qrk81228469276.png") > system("convert tmp/2xkvm1228469276.ps tmp/2xkvm1228469276.png") > > > proc.time() user system elapsed 0.603 0.328 0.762