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(313.737,312.276,309.391,302.950,300.316,304.035,333.476,337.698,335.932,323.931,313.927,314.485,313.218,309.664,302.963,298.989,298.423,301.631,329.765,335.083,327.616,309.119,295.916,291.413,291.542,284.678,276.475,272.566,264.981,263.290,296.806,303.598,286.994,276.427,266.424,267.153,268.381,262.522,255.542,253.158,243.803,250.741,280.445,285.257,270.976,261.076,255.603,260.376,263.903,264.291,263.276,262.572,256.167,264.221,293.860,300.713,287.224,275.902,271.115,277.509,279.681,276.239,271.037,266.148,259.497,266.795,298.305,303.725,289.742,276.444,268.606) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '0' > 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/1tay41293384066.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/23kx61293384066.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.872505458 0.670209264 0.545410054 0.525311540 [6] 0.558868515 0.561066471 0.490738580 0.402435450 0.361179115 [11] 0.409828098 0.524277856 0.566612858 0.424275475 0.228828705 [16] 0.109141610 0.077789071 0.088522748 0.071104490 -0.008367748 [21] -0.100049708 -0.145204649 -0.109588053 -0.019739366 0.013654511 [26] -0.097323015 -0.242000373 -0.316495882 -0.318168419 -0.280645667 [31] -0.266438855 -0.307402059 -0.356749569 -0.360038199 -0.304089847 [36] -0.210892386 -0.170644253 -0.234872897 -0.315602005 -0.342677460 [41] -0.314156045 -0.257927160 -0.231970972 -0.246400433 -0.267638988 [46] -0.254431610 -0.197329349 -0.122042805 -0.085594124 -0.115580816 [51] -0.159831984 -0.170135159 -0.145366118 -0.101523238 -0.081655583 [56] -0.093957237 -0.114377192 -0.111883945 -0.083134363 -0.045956971 [61] -0.029246332 > (mypacf <- c(rpacf$acf)) [1] 0.8725054579 -0.3814137236 0.3450834206 0.1638430056 0.1285019571 [6] -0.0646535199 -0.0994803863 0.0675279371 0.0660287889 0.2533990482 [11] 0.2327739593 -0.2340769136 -0.5500400747 0.0696279874 -0.0507201569 [16] -0.1929124447 -0.0483447821 0.0526097089 -0.0798284326 -0.0645154757 [21] 0.0422476834 0.0012370325 -0.0426384724 0.0808536535 -0.0850879867 [26] 0.0402621011 -0.0014971525 -0.0212659253 0.0598617079 0.0209330929 [31] 0.0011626698 0.0248957584 0.0766609549 -0.1090187762 -0.0257215525 [36] 0.0023782901 0.0506775102 -0.0314401024 -0.0568244149 0.0473894092 [41] -0.0538372232 -0.1151259030 0.1188802039 -0.0843177445 -0.0737246622 [46] 0.0131776174 -0.0204612990 0.0221722358 0.0488358835 -0.0464695132 [51] -0.0335774977 -0.0024446602 0.0073726572 -0.0435094252 0.0003955853 [56] -0.0306214081 -0.0707974595 -0.0284801947 -0.0238374098 0.0078956464 > 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/37kec1293384066.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/4s3ci1293384066.tab") > > try(system("convert tmp/1tay41293384066.ps tmp/1tay41293384066.png",intern=TRUE)) character(0) > try(system("convert tmp/23kx61293384066.ps tmp/23kx61293384066.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.627 0.322 3.547