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(137,136,133,126,120,114,116,153,162,161,149,139,135,130,127,122,117,112,113,149,157,157,147,137,132,125,123,117,114,111,112,144,150,149,134,123,116,117,111,105,102,95,93,124,130,124,115,106,105,105,101,95,93,84,87,116,120,117,109,105) > par5 = '12' > par4 = '0' > 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/1exsf1228674302.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/22lf31228674302.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.0000000000 0.3136963678 -0.1184008049 -0.3231596013 -0.2932300007 [6] -0.0896214630 -0.0147951283 -0.0591961951 -0.2240410163 -0.2398182994 [11] -0.0837219930 0.2737879004 0.7787269791 0.2306114100 -0.0974277930 [16] -0.2623042078 -0.2305940832 -0.0634174569 -0.0134552698 -0.0581948392 [21] -0.1736318144 -0.1737702754 -0.0424388224 0.2048884601 0.5694662888 [26] 0.1630389000 -0.0880812186 -0.2168980750 -0.1603012360 -0.0291570879 [31] 0.0059425765 -0.0349358061 -0.1118827739 -0.1055580910 -0.0471175410 [36] 0.1336217580 0.3755736185 0.0969806253 -0.0795177137 -0.1323813466 [41] -0.0932377040 -0.0052323329 0.0115769052 -0.0093794684 -0.0582216899 [46] -0.0583985145 -0.0317411061 0.0746810655 0.1835156326 0.0421335581 [51] -0.0359710887 -0.0674594080 -0.0473666942 -0.0077536613 0.0067582722 [56] 0.0094519501 0.0055628798 0.0015857988 0.0002106749 > (mypacf <- c(rpacf$acf)) [1] 0.313696368 -0.240469740 -0.237388327 -0.160921231 -0.038826310 [6] -0.139363235 -0.195079224 -0.352158498 -0.358297707 -0.407680833 [11] -0.239239345 0.522685827 -0.354973396 0.007523254 0.052410975 [16] 0.035674562 -0.005671304 0.003505767 -0.007053770 0.052112365 [21] 0.021401949 0.062282604 -0.097145081 -0.034582612 0.012162587 [26] -0.099673854 -0.107338319 -0.023197378 -0.093135465 -0.049169047 [31] -0.034612796 0.010176748 0.019817249 -0.101719943 0.047091766 [36] -0.113980045 -0.045203855 -0.058932391 0.049085017 -0.116745300 [41] -0.028018360 -0.058471760 0.020818863 -0.062980779 -0.002652949 [46] 0.047683193 -0.031244575 -0.152245161 0.093403306 0.034193572 [51] -0.098111887 -0.004923892 -0.046130259 -0.044377094 -0.058632891 [56] 0.065899726 -0.008385013 0.044119358 > 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/39sdc1228674302.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/4diyn1228674302.tab") > > system("convert tmp/1exsf1228674302.ps tmp/1exsf1228674302.png") > system("convert tmp/22lf31228674302.ps tmp/22lf31228674302.png") > > > proc.time() user system elapsed 0.610 0.329 0.861