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(6,5,2,3,-2,-4,0,1,4,-3,-3,0,6,-1,0,-1,1,-4,-1,-1,0,3,0,8,8,8,8,11,13,5,12,13,9,11,7,12,11,10,13,14,10,13,12,13,17,15,6,9,6,11,12,13,11,16,16,19,14,15,12,14,16,13,13,15,12,13,12,15,10,8,11,8) > 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/html/rcomp/tmp/1sctm1260969018.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/2950o1260969018.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.388212100 -0.009435488 -0.051042078 0.074505947 [6] 0.041048084 -0.033917863 -0.070807624 0.073542651 -0.087139440 [11] 0.011018455 -0.052496986 0.208749292 -0.089355135 -0.020132539 [16] -0.009740169 0.084855707 -0.036465270 -0.037523407 -0.028123197 [21] 0.066537739 -0.105399680 -0.046570369 0.031223842 0.033434955 [26] -0.004577087 -0.099565154 0.109486986 -0.070469039 0.078272766 [31] 0.003404409 -0.063445341 0.140694792 -0.007024156 -0.154873223 [36] 0.043883221 -0.049722328 0.142105258 -0.167417144 0.135239628 [41] -0.139866197 0.005769008 0.044071985 0.056546265 0.005928908 [46] -0.059863622 -0.064776545 0.090064606 -0.054385092 > (mypacf <- c(rpacf$acf)) [1] -0.388212100 -0.188562052 -0.157000020 -0.017484772 0.070031161 [6] 0.031542272 -0.065748739 0.016189208 -0.092945498 -0.082932895 [11] -0.106801504 0.174344422 0.091600037 0.036163822 0.013974848 [16] 0.054117737 -0.016360279 -0.059827258 -0.050470040 0.009937340 [21] -0.076892097 -0.132491747 -0.053102839 -0.054079599 -0.006481275 [26] -0.097775879 0.048323689 -0.097310029 0.020007545 0.077986717 [31] -0.021452723 0.131158113 0.192723977 -0.033314059 -0.081881690 [36] -0.138639608 0.044715255 -0.076207048 0.100628118 -0.053303982 [41] -0.167836363 -0.102880559 -0.019546107 -0.008916789 -0.092281386 [46] -0.046642602 -0.001237442 -0.058091504 > 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/374y91260969018.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/441961260969019.tab") > > try(system("convert tmp/1sctm1260969018.ps tmp/1sctm1260969018.png",intern=TRUE)) character(0) > try(system("convert tmp/2950o1260969018.ps tmp/2950o1260969018.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.577 0.328 3.878