R version 2.9.0 (2009-04-17) Copyright (C) 2009 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(106.8,114.3,105.7,90.1,91.6,97.7,100.8,104.6,95.9,102.7,104,107.9,113.8,113.8,123.1,125.1,137.6,134,140.3,152.1,150.6,167.3,153.2,142,154.4,158.5,180.9,181.3,172.4,192,199.3,215.4,214.3,201.5,190.5,196,215.7,209.4,214.1,237.8,239,237.8,251.5,248.8,215.4,201.2,203.1,214.2,188.9,203,213.3,228.5,228.2,240.9,258.8,248.5,269.2,289.6,323.4,317.2,322.8,340.9,368.2,388.5,441.2,474.3,483.9,417.9,365.9,263,199.4,157.2) > 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/rcomp/tmp/1ngaf1244120041.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/2wpka1244120041.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.95815134 0.88443067 0.79083083 0.69748565 0.61081395 [7] 0.54401771 0.49008193 0.43962989 0.38726342 0.34249377 0.29745757 [13] 0.25389587 0.21593489 0.18814699 0.16327856 0.13693561 0.11743895 [19] 0.10460061 0.09769936 0.09562873 0.09766282 0.10035600 0.09573694 [25] 0.08171019 0.06708796 0.04225327 0.01387125 -0.01529863 -0.04070209 [31] -0.05966305 -0.07551261 -0.08423641 -0.09178130 -0.10358303 -0.11862572 [37] -0.13658427 -0.15523490 -0.17803345 -0.19785612 -0.21031102 -0.22029581 [43] -0.22954632 -0.23585412 -0.24031892 -0.24845205 -0.25994844 -0.27494046 [49] -0.29084357 > (mypacf <- c(rpacf$acf)) [1] 0.9581513354 -0.4103105249 -0.1636494614 0.0913086086 0.0245515585 [6] 0.1477405861 -0.0453502100 -0.1370626251 -0.0555431104 0.1490552547 [11] -0.0647931206 -0.0443892254 0.0385182805 0.0449147494 -0.0407074767 [16] -0.0831098903 0.1054077537 0.0481140462 0.0399359316 -0.0233936635 [21] -0.0413519175 0.0217624183 -0.0501273467 -0.0844078164 0.0678059702 [26] -0.1316897997 -0.0055958298 -0.0009838077 -0.0263183407 0.0928072232 [31] -0.0528766935 0.0090915972 -0.0529999685 -0.0475989100 -0.0061083040 [36] -0.0327524877 -0.0019839993 -0.0801697742 0.0192328065 0.0325609410 [41] -0.0484969862 -0.0664771575 0.0247898309 -0.0097009673 -0.0873300741 [46] -0.0152347043 -0.1078372996 0.0441862583 > 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/3gw3v1244120041.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/4a4zr1244120041.tab") > > system("convert tmp/1ngaf1244120041.ps tmp/1ngaf1244120041.png") > system("convert tmp/2wpka1244120041.ps tmp/2wpka1244120041.png") > > > proc.time() user system elapsed 0.566 0.308 0.755