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(54156,53661,52441,50648,48141,46127,45623,56527,60205,61321,58088,54623,53495,51824,50518,49050,47111,45264,44357,54862,57871,59070,56273,52837,51702,49447,48965,46922,46256,45200,44471,53119,55016,56641,51847,47990,45744,46390,44461,41582,40813,38096,35461,44375,46255,45610,43375,40167,40628,40590,39473,36735,36634,32806,32907,41076,42254,43215,41116,40373) > par5 = '12' > par4 = '0' > par3 = '1' > 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/1i4971230065253.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/2aht21230065253.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.0000000000 0.2604885795 -0.0693632452 -0.3055922458 -0.3000503307 [6] -0.0686767998 -0.0231306624 -0.0326214725 -0.2457785584 -0.2179123001 [11] -0.0709912093 0.2412267371 0.7478910115 0.1820000546 -0.0483454150 [16] -0.2563300522 -0.2270973519 -0.0387927277 -0.0189278258 -0.0374149165 [21] -0.2032844189 -0.1624603271 -0.0345607648 0.1591893413 0.5388785711 [26] 0.1300563404 -0.0326198656 -0.2132985876 -0.1345227277 -0.0109049406 [31] 0.0036435718 -0.0282090632 -0.1491325503 -0.0994902687 -0.0570822910 [36] 0.1091213351 0.3625783423 0.0852979581 -0.0376320587 -0.1202908904 [41] -0.0706446426 0.0018962631 0.0014900429 -0.0130795805 -0.0812757150 [46] -0.0518840057 -0.0391917211 0.0712544143 0.1731931570 0.0396941779 [51] -0.0067887653 -0.0608738073 -0.0335586658 -0.0143493551 -0.0004435100 [56] 0.0036764925 0.0033883069 0.0014446515 0.0001942874 > (mypacf <- c(rpacf$acf)) [1] 0.260488580 -0.147206113 -0.270321394 -0.183461329 0.003036847 [6] -0.139151155 -0.164818478 -0.375034115 -0.298609575 -0.319546682 [11] -0.154943041 0.545232030 -0.259852409 -0.021380627 0.080301747 [16] 0.047437834 0.021807992 -0.026301270 -0.028464652 0.028197158 [21] -0.022104786 0.059425256 -0.208495960 -0.025404076 -0.006670051 [26] -0.104033836 -0.120668913 0.014203087 -0.094616770 -0.009016806 [31] -0.053972124 0.032344347 -0.005769520 -0.120736993 0.070872971 [36] -0.092688419 -0.065399789 -0.054532433 0.060385796 -0.103312622 [41] -0.062491505 -0.073846781 0.025405389 -0.044287470 0.010683367 [46] 0.015381214 0.001485332 -0.170936694 0.105858912 0.011498020 [51] -0.088312255 -0.051492867 -0.037960121 -0.040362415 -0.030254006 [56] 0.062273171 -0.019836749 0.026716291 > 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/3czq71230065254.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/4ikx01230065254.tab") > > system("convert tmp/1i4971230065253.ps tmp/1i4971230065253.png") > system("convert tmp/2aht21230065253.ps tmp/2aht21230065253.png") > > > proc.time() user system elapsed 0.613 0.334 1.295