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(98.5,97.0,103.3,99.6,100.1,102.9,95.9,94.5,107.4,116.0,102.8,99.8,109.6,103.0,111.6,106.3,97.9,108.8,103.9,101.2,122.9,123.9,111.7,120.9,99.6,103.3,119.4,106.5,101.9,124.6,106.5,107.8,127.4,120.1,118.5,127.7,107.7,104.5,118.8,110.3,109.6,119.1,96.5,106.7,126.3,116.2,118.8,115.2,110.0,111.4,129.6,108.1,117.8,122.9,100.6,111.8,127.0,128.6,124.8,118.5,114.7,112.6,128.7,111.0,115.8,126.0,111.1,113.2,120.1,130.6,124.0,119.4,116.7,116.5,119.6,126.5,111.3,123.5,114.2,103.7,129.5) > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '1' > par1 = '36' > #'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/1acqy1229077961.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/2hldq1229077961.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.301879395 0.168783836 0.470917324 0.100868099 [6] 0.230047394 0.501813977 0.106784170 0.083708366 0.333496319 [11] 0.022760599 0.203268670 0.561188365 0.130826730 0.036332933 [16] 0.229753951 -0.082088989 0.055042841 0.283328735 -0.070339333 [21] -0.049168464 0.110560559 -0.112133683 0.092697396 0.314245034 [26] 0.013194608 -0.065683969 0.090533064 -0.152207274 -0.068943458 [31] 0.124577221 -0.095211089 -0.107677123 -0.050154637 -0.131927414 [36] 0.009909107 0.221085501 > (mypacf <- c(rpacf$acf)) [1] 3.018794e-01 8.543881e-02 4.417102e-01 -1.907938e-01 2.763026e-01 [6] 2.509325e-01 -9.145796e-02 -1.116235e-01 1.233893e-01 -1.053815e-01 [11] 2.022297e-01 3.468931e-01 -2.832001e-02 -2.571110e-01 -1.238194e-01 [16] -1.648079e-01 -4.917572e-02 -6.907151e-03 4.923866e-02 -4.972688e-05 [21] -8.049126e-03 2.786703e-02 8.845231e-02 2.753437e-02 5.799289e-02 [26] -1.572145e-01 5.015823e-02 -1.071779e-01 -6.713050e-02 -8.093102e-02 [31] 1.790020e-01 -1.712338e-02 -1.042598e-01 5.975779e-02 4.140149e-02 [36] 7.888941e-02 > 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/3hi421229077961.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/41c8o1229077961.tab") > > system("convert tmp/1acqy1229077961.ps tmp/1acqy1229077961.png") > system("convert tmp/2hldq1229077961.ps tmp/2hldq1229077961.png") > > > proc.time() user system elapsed 0.540 0.325 1.129