R version 2.8.0 (2008-10-20) Copyright (C) 2008 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(40628,40167,43375,45610,46255,44375,35461,38096,40813,41582,44461,46390,45744,47990,51847,56641,55016,53119,44471,45200,46256,46922,48965,49447,51702,52837,56273,59070,57871,54862,44357,45264,47111,49050,50518,51824,53495,54623,58088,61321,60205,56527,45623,46127,48141,50648,52441,53661,54156,54245,58182,60436,59412,55903,43648,43555,45483,46956,49087,50433,50505,50890,53703,55276,53959,49732,37776,38437,40187,41626,42682,43647,43625,44352,49669,50986,48869,43127,33629,34948,36346,37607,38948,40274,40044,41139,45041,47433,48126,41639,33538,34742,37152,38399,41374,43363,44071,45080,48487,52140,52780,46700,38202,39915,42199,44356,46188,47883,48149,48201,51438,55796,55989,48794,39252,41414,43856,46086,48284,50101) > 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: Write here your technical program description (don't use hard returns!) > 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 (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/1zmx21229613214.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > racf <- acf(x,par1,main='Autocorrelation',xlab='lags',ylab='ACF') > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/22kbv1229613214.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.0000000000 0.3522136435 -0.1160715846 -0.3412686774 -0.3018099932 [6] -0.0647349147 -0.0004138254 -0.0515603562 -0.2685795496 -0.2930679787 [11] -0.0947524548 0.3405632476 0.8688092805 0.3092926631 -0.0918151729 [16] -0.3195679791 -0.2856309275 -0.0701512545 -0.0141693917 -0.0542578699 [21] -0.2423764029 -0.2433867961 -0.0823444940 0.3133309141 0.7698696861 [26] 0.2628683203 -0.0842370734 -0.3019131713 -0.2685522710 -0.0690299650 [31] -0.0031783088 -0.0379325539 -0.2132904204 -0.2199357903 -0.0797269194 [36] 0.2875865665 0.6667832921 0.2157657374 -0.0720964344 -0.2746712670 [41] -0.2418118424 -0.0689775196 0.0028743869 -0.0260893072 -0.1914687517 [46] -0.1896004328 -0.0680221783 0.2647911221 0.5634172255 0.1574548472 [51] -0.0753169532 -0.2291390253 -0.1899067120 -0.0602430986 0.0055015422 [56] -0.0276484642 -0.1556956030 -0.1538906915 -0.0567466137 0.2363767935 [61] 0.4551285602 > (mypacf <- c(rpacf$acf)) [1] 0.352213643 -0.274133518 -0.237774947 -0.139458371 0.004870346 [6] -0.154337006 -0.172169810 -0.383807238 -0.337204500 -0.344902394 [11] -0.016397486 0.728576019 -0.207538762 0.177819794 0.118691976 [16] 0.092821012 0.032078144 0.007053604 0.003200216 0.001435362 [21] 0.022321406 -0.074163811 -0.051954793 0.067702867 -0.129160325 [26] -0.047552012 -0.036603682 -0.052587695 -0.034195485 0.051334256 [31] 0.015785739 0.009802854 -0.037356928 0.023355484 -0.018370320 [36] -0.077164825 -0.057072056 -0.018589076 -0.021060476 -0.027190151 [41] -0.067482401 -0.012933894 -0.027583256 -0.052962349 -0.003897285 [46] 0.003312312 -0.006335938 -0.077053806 -0.070630942 -0.065458571 [51] 0.036249572 -0.002317842 -0.061659373 -0.001432414 -0.036023700 [56] 0.073806588 -0.004227049 0.006898101 -0.007805614 -0.065211904 > 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/3cac81229613214.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/46g8x1229613214.tab") > > system("convert tmp/1zmx21229613214.ps tmp/1zmx21229613214.png") > system("convert tmp/22kbv1229613214.ps tmp/22kbv1229613214.png") > > > proc.time() user system elapsed 0.580 0.304 0.776