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 = '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/html/rcomp/tmp/1p5n61280159346.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/2p5n61280159346.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 -0.097954414 [51] -0.115535109 -0.130675975 -0.144156277 -0.160537793 -0.175461794 [56] -0.186394957 -0.196097689 -0.209003563 -0.221189947 -0.231388963 [61] -0.242634244 > (mypacf <- c(rpacf$acf)) [1] 0.9756835764 -0.0406015431 0.0614269979 -0.0186503032 -0.0782792094 [6] -0.0122038650 0.0929239414 0.0101919475 -0.1129150426 -0.0014331741 [11] 0.0062769763 -0.0371649603 -0.0967877633 -0.0328430597 0.0239146424 [16] -0.0227280938 -0.0363279891 0.0034364368 0.0681599565 0.0150909472 [21] -0.0747546676 0.0081981380 -0.0105012810 -0.0287561668 -0.0674372236 [26] -0.0178684915 0.0086897745 -0.0185075591 -0.0362834835 0.0018833171 [31] 0.0385359501 0.0071394620 -0.0459305398 0.0043065575 -0.0134764957 [36] -0.0306781112 -0.0402302327 -0.0169458316 0.0049499403 0.0012766042 [41] -0.0293732274 0.0098149660 0.0277141374 0.0072061779 -0.0458690775 [46] 0.0013142316 -0.0132758944 -0.0195447543 -0.0240881147 -0.0112724917 [51] -0.0197045695 0.0100730469 -0.0422122333 -0.0001683952 0.0158460365 [56] 0.0043020596 -0.0406377098 0.0069392034 -0.0173988678 -0.0367821800 > 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/3vo6r1280159347.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/4gpmf1280159347.tab") > > try(system("convert tmp/1p5n61280159346.ps tmp/1p5n61280159346.png",intern=TRUE)) character(0) > try(system("convert tmp/2p5n61280159346.ps tmp/2p5n61280159346.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.608 0.314 0.764