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(13132.1,17665.9,16913,17318.8,16224.2,15469.6,16557.5,19414.8,17335,16525.2,18160.4,15553.8,15262.2,18581,17564.1,18948.6,17187.8,17564.8,17668.4,20811.7,17257.8,18984.2,20532.6,17082.3,16894.9,20274.9,20078.6,19900.9,17012.2,19642.9,19024,21691,18835.9,19873.4,21468.2,19406.8,18385.3,20739.3,22268.3,21569,17514.8,21124.7,21251,21393,22145.2,20310.5,23466.9,21264.6,18388.1,22635.4,22014.3,18422.7,16120.2,16037.7,16410.7,17749.8,16349.8,15662.3,17782.3,16398.9) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '1' > par2 = '1' > par1 = '36' > #'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/1evs81260449777.ps",horizontal=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/2vj5y1260449777.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.327468437 -0.249241501 0.087681645 0.079030918 [6] 0.012583039 0.008393258 -0.109456566 0.189915123 -0.001379531 [11] -0.242202175 -0.175154241 0.598779898 -0.194407976 -0.178788593 [16] -0.017188173 0.158854151 -0.037937917 -0.039940476 0.003864618 [21] 0.114657742 -0.068104508 -0.097471080 -0.132272451 0.346002648 [26] -0.011310663 -0.223470618 -0.020704601 0.174030607 -0.070770881 [31] -0.026482756 0.087770211 -0.032260967 -0.029191178 -0.004980526 [36] -0.121643066 0.198146616 > (mypacf <- c(rpacf$acf)) [1] -0.3274684365 -0.3992957924 -0.2095931510 -0.0913594889 0.0138134376 [6] 0.0894460058 -0.0448433050 0.1955498482 0.1547173846 -0.1163291951 [11] -0.4836471166 0.2798948770 0.0834176149 0.0862922320 -0.1004221226 [16] 0.1412739152 -0.0595843762 -0.0737773329 0.1205400978 -0.0026712751 [21] -0.1364243723 0.0036799595 0.0400209259 -0.1161698252 0.1070080846 [26] 0.0212209205 0.0004083504 -0.0776384687 0.0794030777 -0.0165518586 [31] 0.0888022862 -0.0832774955 -0.0200512276 -0.0041210193 0.0210904994 [36] -0.0551150801 > 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/3indv1260449777.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/42ys01260449777.tab") > > system("convert tmp/1evs81260449777.ps tmp/1evs81260449777.png") > system("convert tmp/2vj5y1260449777.ps tmp/2vj5y1260449777.png") > > > proc.time() user system elapsed 0.535 0.314 0.664