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(698,697,696,694,714,713,698,688,689,689,690,692,688,679,677,673,694,690,673,659,657,654,644,643,638,626,621,615,640,633,620,610,601,595,585,584,580,574,560,550,580,569,551,536,535,526,517,512,510,501,496,491,524,514,495,479,479,467,451,459,461,460,452,449,483,470,442,419,419,406,393,396,390,389,373,371,407,391,357,327,321,317,300,304,296,296,283,279,319,295,255,227,228,233,210,219,212,209,201,198,245,216,173,144,143,152,127,141,129,127,113,117,174,143,103,81,92,104,81,89) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '1' > 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/rcomp/tmp/1jza01280161654.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/2jza01280161654.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.01777314 -0.35077803 -0.19473815 0.10996880 0.16053247 [7] -0.33605182 0.14349164 0.08878660 -0.16608147 -0.27740112 0.04332502 [13] 0.82817054 -0.01446870 -0.31932843 -0.16704928 0.10157512 0.11006873 [19] -0.29592107 0.09856524 0.08696029 -0.13284970 -0.22459322 0.05693805 [25] 0.67979650 -0.02776799 -0.30333485 -0.13884539 0.08906688 0.08638763 [31] -0.24042138 0.05621206 0.07608972 -0.08815051 -0.17156116 0.06249794 [37] 0.54873660 -0.04372201 -0.28054047 -0.12132529 0.09242222 0.07849044 [43] -0.19799530 0.03696230 0.06759600 -0.04735284 -0.13973179 0.05330951 [49] 0.44083200 -0.04481656 -0.22622272 -0.11111543 0.08908791 0.06728455 [55] -0.16456160 0.05086248 0.04162883 -0.02209639 -0.11529789 0.04843757 [61] 0.34685134 > (mypacf <- c(rpacf$acf)) [1] 0.017773143 -0.351204851 -0.205473094 -0.020514695 0.030294779 [6] -0.399487571 0.279669944 -0.178426900 -0.255798006 -0.298913456 [11] 0.006455817 0.694204972 -0.004282050 0.201655387 0.106084221 [16] -0.014653664 -0.130506031 0.079646031 -0.223543494 0.051976594 [21] -0.054315053 -0.021701572 -0.043657112 0.044122381 -0.070329311 [26] -0.011604190 -0.015014511 -0.051848690 0.034498934 0.058337785 [31] -0.035398642 -0.001345541 0.088080768 -0.050251081 0.035790875 [36] -0.008253012 -0.054861766 -0.030392772 -0.024996573 -0.021262638 [41] 0.028357866 0.006384142 0.047372505 0.013629665 0.034183551 [46] -0.026690286 -0.022433736 -0.034831803 0.014551969 0.078348897 [51] 0.007760020 0.055944539 0.011772284 -0.017496327 0.083878626 [56] -0.076269349 -0.007130991 0.016639005 -0.009304259 -0.068936678 > 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/3xrqr1280161654.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/4jrpx1280161654.tab") > > try(system("convert tmp/1jza01280161654.ps tmp/1jza01280161654.png",intern=TRUE)) character(0) > try(system("convert tmp/2jza01280161654.ps tmp/2jza01280161654.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.610 0.080 0.666