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(104.7,115.1,102.5,75.3,96.7,94.6,98.6,99.5,92,93.6,89.3,66.9,108.8,113.2,105.5,77.8,102.1,97,95.5,99.3,86.4,92.4,85.7,61.9,104.9,107.9,95.6,79.8,94.8,93.7,108.1,96.9,88.8,106.7,86.8,69.8,110.9,105.4,99.2,84.4,87.2,91.9,97.9,94.5,85,100.3,78.7,65.8,104.8,96,103.3,82.9,91.4,94.5,109.3,92.1,99.3,109.6,87.5,73.1,110.7,111.6,110.7,84,101.6,102.1,113.9,99,100.4,109.5,93.1,77,108,119.9,105.9,78.2,100.3,102.2,97,101.3,89.2,93.3,88.5,61.5,95) > 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/18s5j1229160128.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/283pz1229160128.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.06419444 -0.29239666 -0.08144119 0.15468755 0.08883093 [7] 0.03770109 0.03803685 0.19227612 -0.17819243 -0.41235817 -0.02093735 [13] 0.69931488 -0.02206066 -0.30350418 -0.16634417 0.05948140 0.03496496 [19] -0.03687207 -0.02208251 0.13217856 -0.19912236 -0.37641279 -0.02272550 [25] 0.51634045 -0.01722800 -0.22400218 -0.19128581 0.04373417 0.05100477 [31] -0.04928354 0.03021702 0.13579471 -0.15839986 -0.26015415 -0.01061626 [37] 0.44243450 0.05350272 -0.14167539 -0.13992741 0.06169577 0.03677712 [43] -0.04359810 0.02597343 0.11319690 -0.14756280 -0.24170829 -0.06187931 [49] 0.31909815 > (mypacf <- c(rpacf$acf)) [1] 0.0641944447 -0.2977445701 -0.0418344831 0.0851021339 0.0399542066 [6] 0.1015238465 0.0867639588 0.2426693395 -0.2055957312 -0.3626098377 [11] -0.1302719440 0.6307883482 -0.1956087971 -0.0758128747 -0.1467257111 [16] -0.0184138412 -0.0635160335 -0.0436861582 -0.0939636017 -0.2114074522 [21] 0.0565254719 0.1115919831 0.0355740292 -0.0825943845 -0.0205992723 [26] 0.0525431696 -0.1158909575 -0.0240448447 -0.0921779165 -0.1154685524 [31] 0.0884110101 0.0454233533 0.0233898581 0.0008157503 -0.0175212264 [36] 0.0813381801 -0.0043790862 -0.0282160107 -0.0582960486 -0.0456993825 [41] -0.0847093006 -0.0181327232 -0.0855908328 -0.0291306954 -0.0271173796 [46] -0.0482804809 -0.0512106571 -0.0673735713 > 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/35kxx1229160128.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/4sfpr1229160129.tab") > > system("convert tmp/18s5j1229160128.ps tmp/18s5j1229160128.png") > system("convert tmp/283pz1229160128.ps tmp/283pz1229160128.png") > > > proc.time() user system elapsed 0.581 0.330 0.693