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(36845,35338,35022,34777,26887,23970,22780,17351,21382,24561,17409,11514,31514,27071,29462,26105,22397,23843,21705,18089,20764,25316,17704,15548,28029,29383,36438,32034,22679,24319,18004,17537,20366,22782,19169,13807,29743,25591,29096,26482,22405,27044,17970,18730,19684,19785,18479,10698,31956,29506,34506,27165,26736,23691,18157,17328,18205,20995,17382,9367,31124,26551,30651,25859,25100,25778,20418,18688,20424,24776,19814,12738,31566,30111,30019,31934,25826,26835,20205,17789,20520,22518,15572,11509) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '1' > 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: > 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/11hrx1261408723.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/2e86f1261408723.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.422294755 0.166972034 -0.198065385 -0.029928955 [6] -0.032583386 0.074889447 -0.094538908 0.087473137 0.223517097 [11] -0.100138480 -0.063438565 -0.201754188 -0.093858353 0.092497616 [16] 0.110793857 -0.035186426 0.039868750 0.056302244 -0.108121437 [21] -0.033650636 0.040916525 -0.219948366 0.373225610 -0.139331355 [26] 0.144876434 -0.079281998 0.068344588 -0.236698153 0.238081767 [31] -0.178381699 0.093925681 0.045689274 -0.083801044 0.071962915 [36] -0.009790847 -0.103072170 -0.008692164 -0.002241201 0.016643478 [41] 0.043072212 -0.038966229 -0.029985433 0.041248338 0.085643842 [46] -0.134805467 0.086741806 -0.063439373 0.066290410 0.030753130 [51] 0.039077087 -0.118349040 0.122278097 -0.079146431 0.068362914 [56] -0.068336082 -0.029932467 0.021929600 0.028360461 0.007777625 [61] -0.075442991 > (mypacf <- c(rpacf$acf)) [1] -0.4222947547 -0.0138265543 -0.1611884365 -0.2117141715 -0.1486904261 [6] -0.0190460938 -0.1442488456 -0.0663017332 0.3302599917 0.1667887359 [11] -0.0963956450 -0.2433175356 -0.3076141793 -0.2058245376 -0.0321020437 [16] -0.0466795719 -0.1080581704 0.0007113983 -0.0611930372 -0.0945710768 [21] 0.2703168520 -0.0438033356 0.1063620658 -0.0858761066 -0.1003365101 [26] -0.0444537955 0.1612139519 -0.0925858060 0.0622059299 0.0170332930 [31] -0.0216640237 -0.0266957227 -0.0676827298 0.0068262506 0.0838935509 [36] -0.0568138518 -0.0115424086 -0.1062366207 0.0057152095 0.0466135952 [41] -0.0963633414 -0.0414970716 0.0185910383 0.0237834536 -0.0042904322 [46] 0.0317961203 0.0698618922 0.0134330682 0.0340689224 -0.0055355114 [51] 0.0854774904 -0.0701001811 -0.0910523463 0.0551812986 0.0090954328 [56] -0.0171015471 0.0403992698 -0.0985153189 0.0783169674 -0.0394847876 > 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/3txqx1261408723.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/4734h1261408723.tab") > > try(system("convert tmp/11hrx1261408723.ps tmp/11hrx1261408723.png",intern=TRUE)) character(0) > try(system("convert tmp/2e86f1261408723.ps tmp/2e86f1261408723.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.611 0.323 0.783