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(103.5,104.6,118.6,106.3,110.7,121.6,107,107.6,125.6,113.5,129.2,130.9,104.7,115.2,124.5,112.3,127.5,120.6,117.5,117.7,120.4,125,131.6,121.1,114.2,112.1,127,116.8,112,129.7,113.6,115.7,119.5,125.8,129.6,128,112.8,101.6,123.9,118.8,109.1,130.6,112.4,111,116.2,119.8,117.2,127.3,107.7,97.5,120.1,110.6,111.3,119.8,105.5,108.7,128.7,119.5,121.1,128.4) > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '1' > 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/1esrg1259334355.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/2f8071259334355.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.616895671 0.020255738 0.343668305 -0.432850737 [6] 0.239112793 0.102209196 -0.357559815 0.315991188 -0.034294764 [11] -0.175498157 0.214725933 -0.179134542 0.023815442 0.095731672 [16] -0.077490586 -0.032350469 0.113754851 -0.006603738 -0.143954566 [21] 0.125624288 -0.001949390 -0.149894214 0.281839149 -0.251658176 [26] 0.067041033 0.080366579 -0.057463304 -0.024511666 0.060499961 [31] -0.102497110 0.099710187 -0.012734243 -0.097688144 0.109530760 [36] -0.053802445 -0.011126506 > (mypacf <- c(rpacf$acf)) [1] -0.6168956710 -0.5816619640 0.0112415124 -0.1983323214 -0.1602511663 [6] 0.1058595554 -0.1219910687 -0.1401756986 0.0773182242 0.1243456116 [11] 0.0219559811 -0.1294644390 -0.1080004525 -0.1882134942 -0.0326388220 [16] -0.1021810393 -0.0526725058 0.2246441382 -0.0008495132 -0.1594577741 [21] 0.0616989467 -0.0690969007 0.0819358601 -0.0091840514 0.0501552930 [26] -0.2654844532 0.1037835243 0.1197690170 0.0074651708 -0.0243287464 [31] -0.0109967330 -0.1142616692 -0.1385204641 -0.0322445594 -0.0633476846 [36] -0.1130550239 > 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/356cr1259334355.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/4ix071259334355.tab") > > system("convert tmp/1esrg1259334355.ps tmp/1esrg1259334355.png") > system("convert tmp/2f8071259334355.ps tmp/2f8071259334355.png") > > > proc.time() user system elapsed 0.564 0.325 0.669