R version 2.9.0 (2009-04-17) Copyright (C) 2009 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(2981.85,3080.58,3106.22,3119.31,3061.26,3097.31,3161.69,3257.16,3277.01,3295.32,3363.99,3494.17,3667.03,3813.06,3917.96,3895.51,3801.06,3570.12,3701.61,3862.27,3970.10,4138.52,4199.75,4290.89,4443.91,4502.64,4356.98,4591.27,4696.96,4621.40,4562.84,4202.52,4296.49,4435.23,4105.18,4116.68,3844.49,3720.98,3674.40,3857.62,3801.06,3504.37,3032.60,3047.03,2962.34,2197.82,2014.45,1862.83,1905.41,1810.99,1670.07,1864.44,2052.02,2029.60,2070.83,2293.41,2443.27,2513.17,2466.92,2502.66,2539.91) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > 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: > 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 (par6 == 'White Noise') par6 <- 'white' else par6 <- 'ma' > par7 <- as.numeric(par7) > 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/1rzdw1292957859.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > racf <- acf(x, par1, main='Autocorrelation', xlab='time lag', ylab='ACF', ci.type=par6, ci=par7, sub=paste('(lambda=',par2,', d=',par3,', D=',par4,', CI=', par7, ', CI type=',par6,')',sep='')) > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/2rzdw1292957859.ps",horizontal=F,onefile=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.969709749 0.927114239 0.880727179 0.825499738 [6] 0.757929365 0.676520924 0.592702844 0.510666871 0.422414477 [11] 0.329462809 0.240564058 0.149834950 0.062750013 -0.021914790 [16] -0.104584951 -0.181137338 -0.246773945 -0.307295628 -0.358635364 [21] -0.400480393 -0.431993446 -0.453610411 -0.470050306 -0.477471155 [26] -0.475934067 -0.465714102 -0.451671960 -0.428500720 -0.408918515 [31] -0.389829031 -0.362994979 -0.335037671 -0.304252549 -0.272370279 [36] -0.243856957 -0.207872435 -0.173818491 -0.143488017 -0.114035484 [41] -0.081901621 -0.051592945 -0.026828054 -0.009929333 0.004094391 [46] 0.021947175 0.034178301 0.044547186 0.051473229 0.055810435 [51] 0.055557598 0.050767052 0.046026369 0.042535103 0.038242305 [56] 0.031827717 0.025703277 0.020044891 0.016058455 0.011365959 [61] 0.006418278 > (mypacf <- c(rpacf$acf)) [1] 0.969709749 -0.221624071 -0.046544429 -0.163510883 -0.197453515 [6] -0.227152652 -0.018451199 0.016018220 -0.120690028 -0.071445810 [11] 0.040010339 -0.148193979 0.006088211 -0.034915808 -0.062647072 [16] -0.030466729 0.100892463 -0.061790064 0.033196592 0.028540590 [21] 0.025763722 -0.031591652 -0.027102511 0.015141852 -0.027833148 [26] 0.031226083 -0.038155836 0.056881190 -0.213053954 -0.084068918 [31] 0.072696034 -0.063805325 0.037545217 0.051389820 -0.098180001 [36] 0.107476981 -0.069310197 0.005850634 -0.072786574 0.144787851 [41] -0.063917701 -0.071443064 -0.066751913 -0.008872806 0.014019826 [46] -0.021503764 0.058787714 -0.071022840 -0.051232908 -0.095114678 [51] -0.030285821 0.060535392 0.007134110 0.029540509 -0.012866018 [56] -0.003815485 0.008968907 0.027083381 -0.031433837 -0.020893698 > 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/3oqt41292957859.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/4g0ap1292957859.tab") > > try(system("convert tmp/1rzdw1292957859.ps tmp/1rzdw1292957859.png",intern=TRUE)) character(0) > try(system("convert tmp/2rzdw1292957859.ps tmp/2rzdw1292957859.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.614 0.343 3.740