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(24.3,29.4,31.8,36.7,37.1,37.7,39.4,43.3,39.6,34.3,32,29.6,22.3,28.9,31.7,34.2,38.6,37.2,38.8,43.4,38.8,36.3,33,29.2,22.64,28.44,30.14,34.39,36.82,36.74,38.9,42.8,39.09,37.49,33.17,30.98,21.2,27.8,29,35.4,37.5,34.7,38.4,39.9,35.9,34.7,30.4,29,21.5,28,29.3,34.3,36.6,36.2,37.5,41.6,39.4,37.3,32.7,30.7,22.9,29.1,29.5,37.1,37.7,38.4,39.4,40.6,39.7,36.6,32.8,31.6,24.1,30.3,31.8,38.7,37.8,38.4,40.7,43.8,41.5,39.3,35.9,33.4) > 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/1hsle1290026381.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/2hsle1290026381.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.00000000 0.06850015 0.22833324 -0.12652643 -0.13208659 -0.34069913 [7] -0.18311002 -0.37319605 -0.15657784 -0.14979126 0.16453239 0.07739356 [13] 0.79785542 0.08193851 0.22675730 -0.12882245 -0.07592999 -0.31266361 [19] -0.14097754 -0.31230637 -0.14106071 -0.10410141 0.09513427 0.08274488 [25] 0.65564883 0.06009753 0.21800762 -0.13190087 -0.05454485 -0.24049835 [31] -0.13498099 -0.24482486 -0.09777952 -0.08989153 0.07201772 0.06128491 [37] 0.49922355 0.07200319 0.14256465 -0.08383044 -0.05017179 -0.19995114 [43] -0.07875707 -0.21573383 -0.07242313 -0.06352241 0.05014968 0.06691867 [49] 0.33149046 > (mypacf <- c(rpacf$acf)) [1] 0.0685001479 0.2246953049 -0.1630003088 -0.1770202952 -0.2830020564 [6] -0.1238971914 -0.3209500261 -0.2684958287 -0.2825602969 -0.1095229411 [11] -0.2586054642 0.6535318876 -0.0191303578 -0.1631283585 -0.1788054185 [16] 0.0019814569 -0.0736423013 -0.0005271882 0.1339886556 0.0304896162 [21] 0.0775350344 -0.1313967997 -0.0642252737 0.0373395104 -0.0549625605 [26] 0.0011667675 0.0074164105 -0.0065197884 0.0884251333 -0.0811280467 [31] -0.0028305232 0.0664364397 -0.0217292881 0.0078905777 -0.0491320431 [36] -0.0871813468 0.0458239063 -0.1151473987 0.0961977650 0.0104782659 [41] -0.0422670047 0.0493637463 -0.0903719767 -0.0983056414 -0.0439829147 [46] 0.0629002839 0.0356026880 -0.1661195693 > 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/3kbk21290026381.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/45biq1290026381.tab") > > try(system("convert tmp/1hsle1290026381.ps tmp/1hsle1290026381.png",intern=TRUE)) character(0) > try(system("convert tmp/2hsle1290026381.ps tmp/2hsle1290026381.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.574 0.319 1.213