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(194.9,195.5,196,196.2,196.2,196.2,196.2,197,197.7,198,198.2,198.5,198.6,199.5,200,201.3,202.2,202.9,203.5,203.5,204,204.1,204.3,204.5,204.8,205.1,205.7,206.5,206.9,207.1,207.8,208,208.5,208.6,209,209.1,209.7,209.8,209.9,210,210.8,211.4,211.7,212,212.2,212.4,212.9,213.4,213.7,214,214.3,214.8,215,215.9,216.4,216.9,217.2,217.5,217.9,218.1,218.6,218.9,219.3,220.4,220.9,221,221.8,222,222.2,222.5,222.9,223.1) > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '0' > par3 = '1' > par2 = '1' > par1 = '36' > #'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/12z3a1291665063.ps",horizontal=F,onefile=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/22z3a1291665063.ps",horizontal=F,onefile=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.14952896 0.10969713 -0.10039401 -0.17015861 -0.16983998 [7] -0.02020430 -0.02972987 -0.09245146 -0.07572583 0.04371029 -0.11339824 [13] -0.01858596 0.12899551 0.05506913 0.02433451 -0.03270466 0.04663436 [19] -0.15809450 0.06157106 -0.05770800 -0.08033249 -0.16162201 0.08666909 [25] -0.08938086 0.02805441 0.06388153 0.05051432 -0.04219340 -0.04771726 [31] -0.06676689 -0.06108597 -0.01778900 0.14731995 0.00731204 -0.06434670 [37] 0.07181656 > (mypacf <- c(rpacf$acf)) [1] 0.149528963 0.089335670 -0.132691980 -0.154538470 -0.108104290 [6] 0.043107650 -0.034552059 -0.152155436 -0.092911960 0.078494404 [11] -0.147325019 -0.080086853 0.135912893 0.013976686 -0.068142901 [16] -0.098924649 0.114427316 -0.129741204 0.033562655 -0.090594232 [21] -0.062878221 -0.164196898 0.093660805 -0.103644397 -0.045354715 [26] -0.002027102 -0.027550324 -0.060179048 -0.167316066 -0.073965047 [31] -0.020603226 -0.085152601 0.023171910 -0.060175084 -0.115710840 [36] -0.006862369 > 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/3yr111291665063.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/4r00m1291665063.tab") > > try(system("convert tmp/12z3a1291665063.ps tmp/12z3a1291665063.png",intern=TRUE)) character(0) > try(system("convert tmp/22z3a1291665063.ps tmp/22z3a1291665063.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.569 0.318 1.173