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(376,375,374,372,370,369,370,372,373,373,374,376,371,374,369,363,357,366,362,366,361,362,358,363,360,360,348,345,332,333,323,327,332,337,336,337,343,337,326,321,309,302,293,287,292,292,289,302,310,295,276,264,257,243,227,226,226,229,224,240,244,226,208,199,193,180,167,164,166,173,169,191,193,166,143,147,139,129,115,108,106,116,108,135) > 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/1v89c1282231489.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/2v89c1282231489.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.217014786 0.024274007 -0.055940666 0.076621231 [6] -0.287804479 -0.315306741 -0.292999544 0.028046001 -0.128321779 [11] -0.047245087 0.264160437 0.669400512 0.166361616 0.022762871 [16] 0.037753486 0.070095418 -0.257645109 -0.318263970 -0.197389230 [21] -0.068948518 -0.103973692 -0.030044933 0.250409544 0.422207918 [26] 0.101163195 0.014186334 0.043458459 0.057801382 -0.218202757 [31] -0.194366935 -0.161217631 -0.129591568 -0.106376526 -0.017080789 [36] 0.134994388 0.207652882 0.036883383 0.050467376 0.061648990 [41] 0.006385695 -0.160501242 -0.081154121 -0.159883230 -0.084845680 [46] -0.110148303 0.018398264 0.037793541 0.068457934 > (mypacf <- c(rpacf$acf)) [1] 0.21701479 -0.02394931 -0.05894557 0.10750595 -0.34866216 -0.20615224 [7] -0.20582784 0.07133884 -0.15535122 -0.07665488 0.26926153 0.52961788 [13] -0.03618988 -0.07429279 0.03252675 -0.02946971 -0.03131156 -0.02841057 [19] 0.07704007 -0.11116238 0.12041837 0.07487761 -0.06665029 -0.05769260 [25] -0.06967681 -0.02388138 -0.13557180 0.08361898 0.02538848 0.11952944 [31] -0.02425206 -0.12350121 -0.02105872 -0.10058895 -0.12901770 -0.13382432 [37] -0.01130556 0.07604544 0.06457798 -0.03614100 -0.05966516 -0.01802037 [43] -0.15533115 0.04807486 -0.11836319 0.04291615 0.02250760 0.03803940 > 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/3rz7l1282231489.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/42roo1282231489.tab") > > try(system("convert tmp/1v89c1282231489.ps tmp/1v89c1282231489.png",intern=TRUE)) character(0) > try(system("convert tmp/2v89c1282231489.ps tmp/2v89c1282231489.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.570 0.303 0.733