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(8.6,8.5,8.4,8.0,7.9,8.1,8.6,8.8,8.8,8.6,8.3,8.3,8.3,8.4,8.4,8.5,8.6,8.6,8.6,8.6,8.6,8.5,8.4,8.4,8.4,8.5,8.5,8.6,8.6,8.4,8.2,8.0,8.0,8.0,8.0,7.9,7.9,7.8,7.9,8.0,7.9,7.4,7.2,7.0,7.0,7.1,7.2,7.2,7.0,6.9,6.8,6.8,6.8,6.9,7.2,7.3,7.2,7.1,7.1,7.3,7.5,7.6,7.7,7.7,7.7,7.8,8.0,8.1,8.1,8.0,8.1,8.2,8.3,8.4,8.6,8.6,8.7,8.8,8.9) > 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/11llq1290541233.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/21llq1290541233.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.514283488 0.028566977 -0.340786717 -0.259093821 [6] -0.047533718 0.199587943 0.317292543 0.218026628 0.106606763 [11] 0.047178795 0.099837255 0.105905573 0.012941706 -0.016101387 [16] -0.033440676 -0.085891376 -0.085674960 -0.056199034 0.108095708 [21] 0.167056216 0.131711075 -0.026749078 -0.184984158 -0.295953877 [26] -0.230691321 -0.008102633 0.126707526 0.038920341 -0.125616787 [31] -0.143856369 -0.033579182 0.065894493 0.001739989 -0.056562614 [36] -0.290872418 -0.273775516 -0.139865649 0.157672397 0.186923250 [41] 0.151803182 -0.018810921 -0.130680933 -0.160399245 -0.143077269 [46] -0.043378521 0.062172129 0.138238197 0.119773542 > (mypacf <- c(rpacf$acf)) [1] 0.5142834883 -0.3207566585 -0.2958762220 0.1588295049 0.0189534039 [6] 0.1014287138 0.1713099059 -0.0245970047 0.1518484870 0.1565992528 [11] 0.1244876965 0.0498349861 -0.0985930754 0.0921580822 -0.0395535189 [16] -0.2605645419 -0.0540774045 -0.1546390306 0.0861368968 0.0147809654 [21] -0.1045646363 0.0058175575 -0.0796243402 -0.1282179486 0.0222965793 [26] 0.0051355024 -0.0221303084 -0.1600681712 -0.0919263526 0.1490256293 [31] 0.0534281421 0.0651334861 -0.0801272939 0.0893572477 -0.2282651162 [36] 0.0752434327 0.0423519109 0.0463192757 -0.0590914884 0.1527843931 [41] -0.0669172113 0.0135722704 0.0701533878 -0.0284976735 -0.0008056089 [46] 0.0333381074 0.0618345677 -0.0267888717 > 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/3mm2d1290541233.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/47mi11290541233.tab") > > try(system("convert tmp/11llq1290541233.ps tmp/11llq1290541233.png",intern=TRUE)) character(0) > try(system("convert tmp/21llq1290541233.ps tmp/21llq1290541233.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.594 0.323 1.203