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(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 = '0' > 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/12qb31280159149.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/22qb31280159149.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.975683576 0.950007880 0.927872869 0.905602994 [6] 0.879883054 0.854066211 0.833784377 0.814808489 0.790183522 [11] 0.765710660 0.743466919 0.720273572 0.691826850 0.662247940 [16] 0.636206755 0.610191459 0.581656215 0.554105456 0.532193571 [21] 0.512016630 0.487185169 0.463043518 0.441013255 0.418263815 [26] 0.391037615 0.363401330 0.339296076 0.315528228 0.289032584 [31] 0.263865903 0.243580406 0.224785942 0.202421501 0.180772982 [36] 0.161341340 0.141016580 0.117227895 0.093264931 0.072827460 [41] 0.053619965 0.032015009 0.012287750 -0.002904213 -0.016680002 [46] -0.034012652 -0.050782635 -0.065275062 -0.080178393 > (mypacf <- c(rpacf$acf)) [1] 0.975683576 -0.040601543 0.061426998 -0.018650303 -0.078279209 [6] -0.012203865 0.092923941 0.010191947 -0.112915043 -0.001433174 [11] 0.006276976 -0.037164960 -0.096787763 -0.032843060 0.023914642 [16] -0.022728094 -0.036327989 0.003436437 0.068159956 0.015090947 [21] -0.074754668 0.008198138 -0.010501281 -0.028756167 -0.067437224 [26] -0.017868492 0.008689775 -0.018507559 -0.036283484 0.001883317 [31] 0.038535950 0.007139462 -0.045930540 0.004306558 -0.013476496 [36] -0.030678111 -0.040230233 -0.016945832 0.004949940 0.001276604 [41] -0.029373227 0.009814966 0.027714137 0.007206178 -0.045869077 [46] 0.001314232 -0.013275894 -0.019544754 > 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/3g09c1280159149.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/48rqx1280159149.tab") > > try(system("convert tmp/12qb31280159149.ps tmp/12qb31280159149.png",intern=TRUE)) character(0) > try(system("convert tmp/22qb31280159149.ps tmp/22qb31280159149.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.576 0.309 0.707