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.0,106.8,96.6,100.1,107.7,91.5,97.8,107.4,117.5,105.6,97.4,99.5,98.0,104.3,100.6,101.1,103.9,96.9,95.5,108.4,117.0,103.8,100.8,110.6,104.0,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,111.0,112.4,130.6,109.1,118.8,123.9,101.6,112.8,128.0,129.6,125.8,119.5,115.7,113.6,129.7,112.0,116.8,127.0,112.1,114.2,121.1,131.6,125.0,120.4,117.7,117.5,120.6,127.5,112.3,124.5,115.2,104.7,130.5) > par5 = '12' > par4 = '1' > 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/1rksf1229545963.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/2nrsi1229545963.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.018193138 0.084646527 0.251445341 -0.087742635 [6] 0.119633211 0.180448462 -0.120495067 0.098281341 0.229170604 [11] -0.168148541 -0.056964414 -0.151676236 -0.235807183 0.083967715 [16] -0.066181832 -0.139712521 0.158336732 -0.090993955 -0.211916872 [21] -0.002683652 -0.062225970 -0.139637177 0.177947509 -0.269178197 [26] -0.089722040 0.041700178 -0.035424337 -0.079295885 0.008677477 [31] -0.020495417 0.068409551 0.133246598 -0.153181484 0.039091663 [36] 0.105866536 0.047745918 0.209946390 0.069286910 -0.060005259 [41] 0.106249003 -0.006564469 -0.082052611 0.059456375 0.056762736 [46] -0.094445624 0.137242824 -0.086914699 -0.149676683 -0.004999286 [51] -0.121875509 -0.116793231 0.088737406 -0.068204548 -0.034720760 [56] 0.038884475 -0.201406863 -0.018488750 -0.002431689 -0.087948084 [61] 0.041796399 > (mypacf <- c(rpacf$acf)) [1] 0.018193138 0.084343454 0.250364094 -0.105297815 0.086993596 [6] 0.141496224 -0.106933496 0.023879253 0.218355553 -0.147409497 [11] -0.198370482 -0.221789634 -0.113151988 0.082340262 0.006500134 [16] -0.011004155 0.173461093 -0.025077994 -0.212989027 -0.055247884 [21] 0.202783049 -0.115713123 -0.020159555 -0.308725006 -0.091574643 [26] -0.114427664 0.283562326 0.063311787 0.075932663 -0.028101638 [31] -0.018149034 -0.008447616 0.008746539 0.018649012 0.059814452 [36] -0.047463413 0.021122565 -0.047105341 -0.017287464 -0.053870643 [41] 0.074345450 0.029099316 -0.013278210 -0.080343675 -0.101358378 [46] 0.010724794 0.077416658 -0.149402412 0.003717707 -0.059700673 [51] -0.024519391 -0.032487585 0.020099376 0.037122760 0.054376455 [56] -0.043277535 -0.046106246 -0.122473372 0.041470480 0.022735671 > 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/3d0du1229545963.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/4c50f1229545963.tab") > > system("convert tmp/1rksf1229545963.ps tmp/1rksf1229545963.png") > system("convert tmp/2nrsi1229545963.ps tmp/2nrsi1229545963.png") > > > proc.time() user system elapsed 0.662 0.371 1.373