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,103.3,99.6,100.1,102.9,95.9,94.5,107.4,116,102.8,99.8,109.6,103,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,111.4,129.6,108.1,117.8,122.9,100.6,111.8,127,128.6,124.8,118.5,114.7,112.6,128.7,111,115.8,126,111.1,113.2,120.1,130.6,124,119.4,116.7,116.5,119.6,126.5,111.3,123.5,114.2,103.7,129.5) > par5 = '12' > par4 = '1' > par3 = '0' > par2 = '-1.0' > 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/freestat/rcomp/tmp/1v0ab1229334707.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/freestat/rcomp/tmp/2g6mv1229334707.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.053280199 0.065092467 0.264314999 -0.052828206 [6] 0.154761512 0.161540845 -0.108107914 0.138555778 0.256599708 [11] -0.085152095 0.005374611 -0.109833005 -0.143001380 0.101216955 [16] -0.051382665 -0.070969306 0.186418862 0.035123961 -0.183101799 [21] -0.005144197 0.016511156 -0.117571312 0.117780680 -0.245956200 [26] -0.105839127 0.089256553 0.001627468 -0.105562969 0.007541536 [31] -0.039500470 0.059147478 0.115453069 -0.178814560 0.026220801 [36] 0.102559987 0.011181063 > (mypacf <- c(rpacf$acf)) [1] 0.053280199 0.062430914 0.259482152 -0.085055635 0.142414377 [6] 0.092150326 -0.109011820 0.072513884 0.240033422 -0.091204055 [11] -0.123654678 -0.197993589 -0.069933699 0.052339425 0.009711248 [16] 0.029731195 0.177772492 0.059922443 -0.246112857 -0.073574318 [21] 0.231863548 -0.077877260 -0.035687190 -0.307749285 -0.052873702 [26] -0.043404380 0.252841051 0.050233874 0.147848445 -0.043512581 [31] -0.036408116 -0.017679375 0.050849013 0.023528489 0.004100682 [36] -0.058657347 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/html/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/33dm21229334707.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/freestat/rcomp/tmp/4rzjr1229334707.tab") > > system("convert tmp/1v0ab1229334707.ps tmp/1v0ab1229334707.png") > system("convert tmp/2g6mv1229334707.ps tmp/2g6mv1229334707.png") > > > proc.time() user system elapsed 0.761 0.421 0.885