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(78.1,66.7,79,65.2,66.5,77.2,80.2,77.9,78,86.8,92.9,185.8,91,79.1,84.2,70.1,71.3,79.6,92.3,78.7,82.5,98.2,115.4,205.6,94,83.2,80.3,70.4,71.1,78.8,86.3,77.5,80.1,89.8,99.9,218,85.4,77.5,78.6,68.8,64.8,79.8,94.3,79.9,87.5,99.1,109.9,273.6,91.3,80.6,80.4,71.8,75.5,86.6,91.5,86.8,84.6,88.6,102.1,260.3,79,70.6,79.3,66.8,61.2,72.5,83.5,75.8,83.4,89.4,104.9,251.6,80,76.3,81.1,63.1,63.5,78.8,91.7,83.8,83.8,95.8,108.9,258.2,88.7,79.5,74.3,70.5,59.1,73.2,81.2,75,74.6,89.5,107,246.4,83.6,72.1,68.7,60.1,61.1,72.7,85.3,71.4,75.2,89.8,100.9,222.7) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > 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/1zrlv1289832991.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/2zrlv1289832991.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.00000000 0.13238902 -0.02045171 -0.09171893 -0.17130733 -0.15316289 [7] -0.15964713 -0.16810340 -0.19034646 -0.10963834 -0.05210437 0.09771213 [13] 0.90076386 0.10455843 -0.02999544 -0.09292019 -0.16087603 -0.14692112 [19] -0.15290568 -0.16132160 -0.17675466 -0.09968926 -0.05324409 0.08113490 [25] 0.79666859 0.09599301 -0.01733602 -0.07226871 -0.13038750 -0.11496214 [31] -0.12094990 -0.12854223 -0.14804618 -0.07745325 -0.04518815 0.07072799 [37] 0.67693862 0.08015391 -0.01775778 -0.06821580 -0.11644486 -0.10360321 [43] -0.11102651 -0.12200535 -0.13709341 -0.07936905 -0.05368779 0.04987524 [49] 0.53183338 > (mypacf <- c(rpacf$acf)) [1] 0.132389018 -0.038656086 -0.085411428 -0.152221875 -0.122382465 [6] -0.153171132 -0.188568198 -0.256058732 -0.229230577 -0.266711664 [11] -0.192085494 0.860808051 -0.315676432 -0.155261943 -0.058351837 [16] -0.047606030 -0.090685568 -0.014141150 0.031529367 0.048101580 [21] -0.010693244 0.010866111 -0.057927229 -0.203294060 0.076636956 [26] 0.062454058 0.019607138 0.032050725 0.097470768 0.048286705 [31] 0.030723580 -0.016432963 0.033343749 0.011591371 0.039516719 [36] -0.107778233 0.061085250 0.017153178 -0.006699934 0.002215478 [41] -0.022998175 -0.049587012 -0.080361718 -0.003133015 -0.077060433 [46] -0.056168931 -0.022211366 -0.189926869 > 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/3ks1j1289832991.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/4nszo1289832991.tab") > > try(system("convert tmp/1zrlv1289832991.ps tmp/1zrlv1289832991.png",intern=TRUE)) character(0) > try(system("convert tmp/2zrlv1289832991.ps tmp/2zrlv1289832991.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.580 0.306 0.785