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(8357,7454,8076,7248,7339,7292,7359,7537,7441,8057,8037,8257,8692,8119,8236,7432,7669,7453,7566,7731,7657,8130,8401,8737,9009,7919,8228,7903,7912,7857,7965,8091,8024,8772,8656,8953,9014,8103,8876,8231,8173,8087,8296,8007,8382,9168,9137,9321,9234,8451,9101,8279,8284,8225,8597,8305,8620,9102,9258,9652,9522,8874,9415,8525,8862,8421,8626,8750,8852,9412,9570,9513,9986,8907,9663,8799,8931,8732,8936,9127,9070,9773,9670,9929,10095,9025,9659,8954,9022,8855,9034,9196,9038,9650,9715,10052,10436,9314,9717,8997,9062,8885,9058,9095,9149,9857,9848,10269,10341,9690,10125,9349,9224,9224,9454,9347,9430,9933,10148,10677,10735,9760,10567,9333,9409,9502,9348,9319,9594,10160,10182,10810,11105,9874,10958,9311,9610,9398,9784,9425,9557,10166,10337,10770,11265,10183,10941,9628,9709,9637,9579,9741,9754,10508,10749,11079,11608,10668,10933,9703,9799,9656,9648,9712,9766,10540,10564,10911,11218,10230,10410,9227,9378,9105,9128) > 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/1v3s11263405140.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/26bax1263405140.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.44061480 0.37625483 -0.04908205 -0.21598005 0.02776238 [7] -0.33580295 0.02639844 -0.21704671 -0.04267539 0.33684092 -0.36658930 [13] 0.84686323 -0.38779920 0.35130622 -0.04079108 -0.20477190 0.02977847 [19] -0.30744425 0.01995815 -0.18106783 -0.06407827 0.31679599 -0.33516983 [25] 0.75334000 -0.34648318 0.31823951 -0.03166466 -0.18974897 0.04286699 [31] -0.29674137 0.02462207 -0.16461567 -0.05546498 0.27452978 -0.30334899 [37] 0.67804652 -0.30956776 0.30691404 -0.03551419 -0.16090803 0.03067748 [43] -0.26148688 0.02569918 -0.16928023 -0.03821547 0.23051666 -0.27097766 [49] 0.60860472 > (mypacf <- c(rpacf$acf)) [1] -0.440614805 0.225986827 0.233828801 -0.342122043 -0.325737109 [6] -0.338807469 -0.160878906 -0.245148838 -0.451059806 0.218334038 [11] -0.357277861 0.546476043 0.190164703 -0.079069518 -0.039736370 [16] -0.006302859 -0.043648085 0.054239599 0.034696719 0.088815704 [21] -0.077382104 -0.037874580 -0.080277237 0.065906204 0.052424541 [26] -0.038784926 -0.044609678 0.011193690 0.021898597 -0.050479411 [31] -0.020790749 -0.006455135 0.060900121 -0.061302570 -0.101941513 [36] 0.030640478 0.075669196 0.056491143 -0.036942817 0.013600580 [41] -0.020738111 0.016995704 0.051293879 -0.045877411 0.019867061 [46] 0.020191339 -0.054579959 -0.020078511 > 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/3xuix1263405140.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/4yw941263405140.tab") > > try(system("convert tmp/1v3s11263405140.ps tmp/1v3s11263405140.png",intern=TRUE)) character(0) > try(system("convert tmp/26bax1263405140.ps tmp/26bax1263405140.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.589 0.321 0.922