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(2,2.4,1.5,1.2,1.5,0.6,2.7,3.7,4.9,6.6,7.4,7.2,5.3,4.7,6.1,6.6,7,7.5,6.6,7.8,4.7,5.4,4.3,4.5,5.8,4.6,5.2,3.6,4.8,6.7,6.3,4.8,8.7,6.8,7.4,9,7.9,9.1,8.7,9.8,6.4,6.1,4.7,4.8,4.2,2.8,6.1,5.8,4.9,4.6,4.1,3.6,5.9,4.5,4.8,5.7,5,7,4.6,2.6,5,4.1,3.2,0,2.3,3.8,4.5,5.9,5,4.2,4.5,6) > 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/1smvn1272885642.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/2smvn1272885642.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.000000e+00 7.192008e-01 5.872624e-01 4.515842e-01 2.946158e-01 [6] 2.119134e-01 5.667395e-02 -7.631095e-05 -5.958017e-02 -7.538081e-02 [11] -1.204123e-01 -1.403369e-01 -2.097879e-01 -1.353644e-01 -9.004799e-02 [16] -7.226753e-02 -6.367001e-02 6.996593e-03 1.402488e-01 1.304165e-01 [21] 1.869181e-01 1.302105e-01 1.169286e-01 5.461142e-02 -7.780088e-02 [26] -9.379363e-02 -1.862595e-01 -2.040112e-01 -1.837247e-01 -2.559165e-01 [31] -3.050805e-01 -3.236689e-01 -3.420353e-01 -3.428768e-01 -3.685392e-01 [36] -2.924849e-01 -1.758055e-01 -1.318723e-01 -4.990949e-02 -3.469053e-02 [41] -8.619402e-03 2.239966e-02 1.579903e-02 6.935758e-03 -4.957970e-02 [46] -3.950506e-02 -4.113640e-02 -4.039838e-02 -2.975166e-02 > (mypacf <- c(rpacf$acf)) [1] 0.7192007949 0.1450285944 -0.0292551041 -0.1263708790 0.0210778081 [6] -0.1761356519 0.0318285266 -0.0275552262 0.0504198449 -0.1081163423 [11] 0.0001104496 -0.1861838216 0.2275544273 0.0096189829 0.0196891396 [16] -0.1438026946 0.2286981839 0.1223771859 -0.0748861686 0.0166780342 [21] -0.0977258268 -0.0236644840 -0.1269546848 -0.1870032136 0.1351498587 [26] -0.0754609668 -0.0353699640 0.0125043591 -0.1269112539 -0.0585513706 [31] -0.1180885793 -0.0335786277 -0.0838231599 -0.0481561972 0.0908952346 [36] 0.0420467076 -0.0366514334 -0.0333976473 -0.1007982650 -0.0528076112 [41] 0.0092381653 0.0014689365 -0.0691317474 -0.0033965582 -0.0166880569 [46] -0.0511837824 0.0688122396 0.0255805260 > 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/3w4bt1272885642.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/4h5ah1272885642.tab") > > try(system("convert tmp/1smvn1272885642.ps tmp/1smvn1272885642.png",intern=TRUE)) character(0) > try(system("convert tmp/2smvn1272885642.ps tmp/2smvn1272885642.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.567 0.305 0.854