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.6,98,106.8,96.6,100.1,107.7,91.5,97.8,107.4,117.5,105.6,97.4,99.5,98,104.3,100.6,101.1,103.9,96.9,95.5,108.4,117,103.8,100.8,110.6,104,112.6,107.3,98.9,109.8,104.9,102.2,123.9,124.9,112.7,121.9,100.6,104.3,120.4,107.5,102.9,125.6,107.5,108.8,128.4,121.1,119.5,128.7,108.7,105.5,119.8,111.3,110.6,120.1,97.5,107.7,127.3,117.2,119.8,116.2) > par5 = '12' > par4 = '0' > par3 = '0' > 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/1njum1229992442.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/268d41229992442.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.349572070 0.152248694 0.462404139 0.075801853 [6] 0.182657561 0.487536150 0.074519107 0.125014612 0.340400273 [11] 0.033235155 0.292720436 0.586027283 0.133999682 0.112964486 [16] 0.200575261 -0.093720868 0.064269081 0.149322487 -0.117045379 [21] -0.046253654 -0.013330397 -0.164819128 0.054582031 0.152716200 [26] -0.046415681 -0.067841940 -0.126829911 -0.263165933 -0.170912075 [31] -0.116340589 -0.210527815 -0.174310234 -0.172061953 -0.228222771 [36] -0.123199391 -0.001634167 -0.126458933 -0.181516178 -0.142871015 [41] -0.239788866 -0.208491886 -0.099800757 -0.162158385 -0.192769022 [46] -0.162984003 -0.161309010 -0.089768421 0.016758721 -0.059905295 [51] -0.101143278 -0.040507552 -0.101612949 -0.079944004 -0.021658206 [56] -0.074983364 -0.072632057 -0.040674697 -0.035682797 -0.014032725 > (mypacf <- c(rpacf$acf)) [1] 0.349572070 0.034231128 0.455122197 -0.307872913 0.386298025 [6] 0.120083108 -0.106134844 0.072763538 0.026943817 0.014973775 [11] 0.302848278 0.282364082 -0.123194930 -0.163564545 -0.200982581 [16] -0.060434927 -0.155874099 -0.160930732 -0.003001070 -0.174998938 [21] -0.060343098 -0.074777651 -0.019829487 -0.003138223 0.083147892 [26] -0.066550109 -0.044535761 -0.100806657 -0.060461974 0.078949383 [31] 0.020009753 0.151086535 0.057926931 0.036691273 -0.040849093 [36] 0.110222486 -0.145173088 0.028473184 0.058165413 0.038141084 [41] 0.023444904 -0.060221516 0.067519858 -0.181935804 -0.111738949 [46] 0.049295977 -0.047930683 -0.039446574 -0.048428193 0.039174863 [51] -0.018359568 0.084808764 0.045808320 -0.043980936 -0.074310778 [56] 0.019864089 0.007551004 -0.006559212 -0.083083172 > 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/3m8v71229992442.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/44qn01229992442.tab") > > system("convert tmp/1njum1229992442.ps tmp/1njum1229992442.png") > system("convert tmp/268d41229992442.ps tmp/268d41229992442.png") > > > proc.time() user system elapsed 0.634 0.344 4.468