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(4.256,5.008,4.181,4.666,4.476,4.912,4.340,3.830,4.285,5.537,3.813,4.610,4.207,5.099,4.112,4.199,5.110,4.218,4.736,4.624,4.145,5.299,5.011,4.730,4.619,5.578,5.369,4.902,6.102,5.024,5.731,5.732,4.491,4.755,5.208,4.962,4.163,5.592,5.754,4.929,5.219,4.429,4.143,4.308,3.996,4.634,4.138,3.759,3.922,5.560,4.004,3.937,5.250,3.908,4.814,4.407,3.243,3.740,3.949,3.711) > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '1.0' > 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/freestat/rcomp/tmp/1jjnl1229692886.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/2exw31229692886.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.221179181 0.239443493 0.429195301 0.183062163 [6] 0.160096129 0.154541691 0.108841898 0.114755751 0.198728629 [11] 0.114373942 -0.019830529 0.249823942 -0.067298168 -0.050133326 [16] 0.022752896 -0.190971441 -0.119095242 -0.234057055 -0.244167826 [21] -0.274057518 -0.146030694 -0.176648912 -0.227506551 -0.044477400 [26] -0.211092685 -0.178337619 -0.137862042 -0.233216578 -0.125932647 [31] -0.150980223 -0.180013378 -0.109252270 -0.017960555 -0.062874456 [36] -0.113619683 0.109464372 -0.030850318 -0.035820316 0.041764436 [41] 0.060422937 0.048507547 -0.015540043 0.046810700 0.058062852 [46] 0.028070241 0.050412313 -0.006122422 0.037989914 0.062816813 [51] 0.002126489 0.065274220 0.011124299 0.023921680 0.010768688 [56] 0.001852156 0.017998323 0.019788948 -0.004381183 0.014159138 > (mypacf <- c(rpacf$acf)) [1] 0.221179181 0.200323115 0.375213158 0.031036565 -0.010275215 [6] -0.063846873 -0.002102854 0.038936637 0.168817148 0.038600678 [11] -0.172431442 0.145666457 -0.215783669 -0.036382338 -0.089316310 [16] -0.138950170 -0.059969575 -0.228620088 -0.094692178 -0.177402402 [21] 0.115244769 0.027195673 0.073991633 0.031481917 -0.069609503 [26] -0.006102316 -0.068345461 0.078175283 0.025205888 0.085335634 [31] -0.124300344 -0.009653413 0.010801869 -0.015344456 -0.051603991 [36] 0.018404459 -0.026097779 -0.155490076 -0.057444464 0.109259094 [41] 0.075713902 -0.072704060 -0.039180981 -0.047205796 -0.118165177 [46] -0.016564376 -0.020020339 -0.063078386 0.036371436 -0.058488324 [51] 0.069192428 -0.069608823 0.006277214 0.012856300 -0.019743179 [56] 0.052885747 -0.008797468 -0.002000391 0.029663681 > 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/3hhy71229692886.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/40e441229692886.tab") > > system("convert tmp/1jjnl1229692886.ps tmp/1jjnl1229692886.png") > system("convert tmp/2exw31229692886.ps tmp/2exw31229692886.png") > > > proc.time() user system elapsed 0.807 0.423 0.923