R version 2.11.1 (2010-05-31) Copyright (C) 2010 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(335,334,333,331,329,328,329,331,332,332,333,335,335,333,325,322,322,315,321,324,329,332,322,324,324,323,309,306,305,300,301,302,308,311,301,301,308,302,290,286,286,275,284,289,292,293,285,280,281,280,265,260,254,238,247,246,247,237,222,216,212,209,185,186,178,158,166,162,164,147,132,124,117,120,89,81,71,52,63,62,74,67,53,42) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '1' > 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/rcomp/tmp/1kdre1281787555.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/rcomp/tmp/2kdre1281787555.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.037475498 0.057809546 0.074410973 -0.094458046 [6] 0.194448837 -0.080490380 0.236235312 -0.034980663 0.121436947 [11] -0.012363727 -0.013553207 0.661766656 0.042898809 0.014823675 [16] 0.004731707 -0.070681121 0.053936531 -0.054629095 0.106414432 [21] -0.113266995 0.066627204 -0.078436981 0.013039596 0.420082044 [26] -0.006827818 -0.039732850 -0.070201831 -0.081384044 -0.103818044 [31] -0.064267565 0.065627806 -0.114274952 0.013695494 -0.105247380 [36] 0.019895464 0.253281961 -0.045361272 -0.049031351 -0.112446805 [41] -0.065752297 -0.124382400 -0.114069219 0.032606532 -0.080273178 [46] 0.002068794 -0.108632773 -0.030914373 0.142534490 > (mypacf <- c(rpacf$acf)) [1] 0.037475498 0.056484460 0.070574084 -0.103547071 0.197260269 [6] -0.099091744 0.259862496 -0.125192555 0.220334951 -0.203336850 [11] 0.200797619 0.567523504 0.051025647 -0.221480204 -0.007313064 [16] 0.023336100 -0.108988163 -0.011801282 -0.153620667 -0.211961138 [21] -0.064096837 0.033777427 0.126743680 -0.022175152 -0.109107213 [26] -0.027238595 0.071823615 0.014354896 -0.133467168 -0.099000647 [31] 0.057449289 0.088268197 -0.022698420 0.004921523 -0.010368268 [36] -0.010006047 0.007030340 0.115226009 -0.131820142 -0.070068615 [41] 0.061314486 -0.019789569 -0.068903626 0.050302810 -0.008611059 [46] -0.056652821 -0.124526344 -0.007472317 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/rcomp/tmp/3g5pn1281787555.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/rcomp/tmp/41oob1281787555.tab") > > try(system("convert tmp/1kdre1281787555.ps tmp/1kdre1281787555.png",intern=TRUE)) character(0) > try(system("convert tmp/2kdre1281787555.ps tmp/2kdre1281787555.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.800 0.250 1.033