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(206010,198112,194519,185705,180173,176142,203401,221902,197378,185001,176356,180449,180144,173666,165688,161570,156145,153730,182698,200765,176512,166618,158644,159585,163095,159044,155511,153745,150569,150605,179612,194690,189917,184128,175335,179566,181140,177876,175041,169292,166070,166972,206348,215706,202108,195411,193111,195198,198770,194163,190420,189733,186029,191531,232571,243477,227247,217859,208679,213188,216234,213586,209465,204045,200237,203666,241476,260307,243324,244460,233575,237217,235243,230354,227184,221678,217142,219452,256446,265845,248624,241114,229245,231805,219277,219313,212610,214771,211142,211457,240048,240636,230580,208795,197922,194596,194581,185686,178106,172608,167302,168053,202300,202388,182516,173476,166444,171297,169701,164182,161914,159612,151001,158114,186530,187069,174330,169362) > par5 = '12' > par4 = '1' > par3 = '1' > par2 = '1' > 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/1qg7t1228324532.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/2h64u1228324532.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.142705210 0.150458702 -0.102650047 0.119219928 [6] 0.079966709 0.020784258 0.079030525 -0.038535531 0.181429823 [11] -0.008443802 0.120918153 -0.295359274 0.104108139 0.107717734 [16] -0.030827947 0.015940867 -0.080768244 0.084993770 0.022529503 [21] 0.059603586 0.073971296 -0.040144901 -0.021666466 -0.137698085 [26] 0.030739900 -0.191628355 0.111355117 -0.073304314 0.003762463 [31] -0.118682893 -0.070934904 -0.028761195 -0.016944701 -0.006468217 [36] 0.061266901 0.042436206 0.019686005 -0.043248382 -0.041642698 [41] -0.030835419 0.076058520 -0.029368719 0.018335156 -0.080260933 [46] -0.034563252 0.028947154 -0.099905136 -0.031731103 -0.101644546 [51] 0.082180106 -0.103728831 -0.049858595 -0.094698690 0.108299491 [56] -0.023744844 0.037564835 -0.063842465 -0.134171082 -0.015546836 [61] 0.057977169 > (mypacf <- c(rpacf$acf)) [1] -0.1427052104 0.1327983331 -0.0676245970 0.0825365106 0.1316235580 [6] 0.0134264425 0.0772181816 -0.0177280439 0.1458936170 0.0391286288 [11] 0.0686859257 -0.2844273648 -0.0109058373 0.1863180491 -0.0981755989 [16] -0.0159387591 -0.0020996283 0.0168386381 0.0779040343 0.0186138619 [21] 0.1752698338 -0.0158008473 -0.0910341849 -0.2797115354 -0.0317577471 [26] -0.0847453541 -0.0174289151 -0.0231001867 -0.0440906088 -0.0900886231 [31] -0.0314924300 -0.0001036081 0.2048300788 0.0330493108 0.1280982715 [36] -0.0011954742 0.1071114397 -0.0993110520 -0.0593129953 -0.0639656371 [41] 0.0054522418 -0.1355218118 -0.0306793958 -0.0565598344 0.0781932516 [46] 0.0022203352 0.0145233990 -0.0807309617 0.0024504164 -0.0034297403 [51] -0.0288682651 -0.1456564653 -0.0459236764 -0.0178898693 -0.0588641760 [56] -0.0622014170 0.0217823804 -0.1235818078 0.0169365283 0.1261739563 > 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/37wh31228324532.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/46u621228324532.tab") > > system("convert tmp/1qg7t1228324532.ps tmp/1qg7t1228324532.png") > system("convert tmp/2h64u1228324532.ps tmp/2h64u1228324532.png") > > > proc.time() user system elapsed 0.616 0.330 0.802