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 = '0.5' > 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/1fv6v1228676686.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/2hqex1228676686.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.126187277 0.126865677 -0.077558973 0.120827741 [6] 0.088558481 0.056586563 0.062417141 -0.015683161 0.148658747 [11] -0.016136431 0.119051414 -0.319632899 0.093658194 0.126866655 [16] 0.004165120 0.008952232 -0.066699463 0.056285302 0.028276093 [21] 0.054533566 0.066546493 -0.038353517 -0.025438157 -0.117857110 [26] 0.011599483 -0.176725595 0.106978154 -0.064260981 -0.002604513 [31] -0.113524340 -0.074501193 -0.030700889 -0.019525726 -0.007675564 [36] 0.066796503 0.047632688 0.025144062 -0.044918519 -0.045246627 [41] -0.031322406 0.080137834 -0.035559855 0.029792687 -0.085392375 [46] -0.038173636 0.015548115 -0.109227116 -0.029110473 -0.084100615 [51] 0.088741000 -0.103800166 -0.058607637 -0.111332128 0.103934586 [56] -0.022786602 0.042090591 -0.061489536 -0.136963980 -0.021757719 [61] 0.061638426 > (mypacf <- c(rpacf$acf)) [1] -0.1261872770 0.1127375946 -0.0505665234 0.0955758705 0.1307098692 [6] 0.0560552354 0.0685593896 -0.0106580409 0.1221501945 0.0025539002 [11] 0.0692748548 -0.3187041990 -0.0314262342 0.2025878858 -0.0455117266 [16] 0.0035871908 0.0039031116 0.0298712772 0.0656051527 0.0132412279 [21] 0.1551636248 -0.0443905890 -0.0723965645 -0.2933437100 -0.0837043568 [26] -0.0682540463 0.0341905248 -0.0068707213 -0.0308331433 -0.0506380298 [31] -0.0164800264 0.0167563537 0.1719613072 0.0127813568 0.1226209459 [36] -0.0435504033 0.0679178573 -0.0954421328 -0.0277022582 -0.0617653989 [41] 0.0024596073 -0.1216591442 -0.0001698278 -0.0427830389 0.0758282873 [46] 0.0092827364 -0.0042154203 -0.1098368581 -0.0076290060 0.0080275355 [51] -0.0281436194 -0.1602379638 -0.0560602876 -0.0094003391 -0.0069657645 [56] -0.0177530638 0.0293821188 -0.1218927135 -0.0203239250 0.1009810545 > 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/3qosu1228676686.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/4lr651228676686.tab") > > system("convert tmp/1fv6v1228676686.ps tmp/1fv6v1228676686.png") > system("convert tmp/2hqex1228676686.ps tmp/2hqex1228676686.png") > > > proc.time() user system elapsed 0.605 0.327 0.694