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(62.027,56.493,65.566,62.653,53.470,59.600,42.542,42.018,44.038,44.988,43.309,26.843,69.770,64.886,79.354,63.025,54.003,55.926,45.629,40.361,43.039,44.570,43.269,25.563,68.707,60.223,74.283,61.232,61.531,65.305,51.699,44.599,35.221,55.066,45.335,28.702,69.517,69.240,71.525,77.740,62.107,65.450,51.493,43.067,49.172,54.483,38.158,27.898,58.648,56.000,62.381,59.849,48.345,55.376,45.400,38.389,44.098,48.290,41.267,31.238) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '1' > par3 = '0' > par2 = '1' > par1 = '48' > #'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/1n1os1291379624.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/2gsnv1291379624.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.452148956 0.449558973 0.281776115 0.223750933 [6] 0.211956617 0.168084434 -0.074619647 -0.001694452 -0.082439845 [11] -0.089797189 -0.056428188 -0.319891480 -0.241563042 -0.108712980 [16] -0.004292629 -0.029729528 -0.063120583 -0.234748922 -0.064146467 [21] -0.139695220 -0.038596513 -0.107506450 -0.026424863 -0.029430217 [26] 0.134138767 0.094157658 0.044696001 0.022365503 0.048236060 [31] 0.118708600 0.079833732 0.025689583 -0.045526125 -0.081882012 [36] -0.111848987 -0.128399272 -0.170233900 -0.166764857 -0.164184306 [41] -0.101061876 -0.078375677 -0.065464377 -0.061159607 -0.015531930 [46] 0.013234557 0.023356664 0.011577989 > (mypacf <- c(rpacf$acf)) [1] 0.4521489564 0.3081098682 0.0025355616 -0.0048365172 0.0770623907 [6] 0.0231130269 -0.3071854586 0.0330741057 0.0271256923 -0.0748122068 [11] 0.0249776505 -0.3237081173 0.0006778046 0.2512760495 0.2107314916 [16] -0.1572150939 -0.1550700302 -0.1731768074 0.0206017456 -0.0620478055 [21] 0.0866787374 -0.0035065545 0.1810448181 -0.0598938257 -0.0386617643 [26] 0.1170993668 0.0283540828 -0.0091742744 -0.0943455124 -0.1033213203 [31] -0.1008773029 -0.0203490975 0.0662296987 -0.1098324913 0.0245648561 [36] -0.0987760147 0.0018325701 0.0353876181 0.0033720977 -0.0777107243 [41] 0.0257689052 0.0202773227 0.0246568555 -0.0070075072 0.0387876896 [46] -0.0900109800 -0.0542748779 > 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/31tmj1291379624.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/44b2p1291379624.tab") > > try(system("convert tmp/1n1os1291379624.ps tmp/1n1os1291379624.png",intern=TRUE)) character(0) > try(system("convert tmp/2gsnv1291379624.ps tmp/2gsnv1291379624.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.573 0.319 1.309