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(98.8,100.5,110.4,96.4,101.9,106.2,81,94.7,101,109.4,102.3,90.7,96.2,96.1,106,103.1,102,104.7,86,92.1,106.9,112.6,101.7,92,97.4,97,105.4,102.7,98.1,104.5,87.4,89.9,109.8,111.7,98.6,96.9,95.1,97,112.7,102.9,97.4,111.4,87.4,96.8,114.1,110.3,103.9,101.6,94.6,95.9,104.7,102.8,98.1,113.9,80.9,95.7,113.2,105.9,108.8,102.3,99,100.7,115.5,100.7,109.9,114.6,85.4,100.5,114.8,116.5,112.9,102,106,105.3,118.8,106.1,109.3,117.2,92.5,104.2,112.5,122.4,113.3,100,110.7,112.8,109.8,117.3,109.1,115.9,96,99.8,116.8,115.7,99.4,94.3,91,93.2,103.1,94.1,91.8,102.7,82.6,89.1,104.5) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '1' > par3 = '1' > par2 = '1' > par1 = '60' > #'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/118341260719916.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/2s8pj1260719916.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.602410123 -0.003472667 0.377203500 -0.377392599 [6] 0.139487943 0.168186765 -0.296927761 0.169526644 0.001583031 [11] -0.145739902 0.203849585 -0.157860953 0.002281077 0.067859762 [16] 0.020876512 -0.148662930 0.165964730 -0.003268451 -0.172639177 [21] 0.163409914 0.050782166 -0.320869661 0.462794832 -0.299756840 [26] -0.055116102 0.298952068 -0.254412609 0.046761439 0.155116796 [31] -0.237187267 0.131432078 0.068394155 -0.194404814 0.177140778 [36] -0.120796180 -0.008116144 0.064808801 -0.012336337 -0.099844207 [41] 0.118573056 -0.020281815 -0.067351001 0.055975048 0.069941552 [46] -0.171699983 0.184152450 -0.016518733 -0.181623448 0.254492007 [51] -0.151438979 -0.021054521 0.157725143 -0.208970610 0.110037600 [56] 0.069319556 -0.206317986 0.174934218 -0.033403094 -0.117691063 [61] 0.162673125 > (mypacf <- c(rpacf$acf)) [1] -0.6024101235 -0.5750579961 0.0644620709 0.0084188548 -0.0171353725 [6] 0.1632936557 0.0411844436 -0.0668004887 -0.1390468101 -0.1472934325 [11] 0.0413307279 -0.0285611407 -0.0477689563 -0.1389685475 0.1645002585 [16] -0.0612249989 -0.0473836984 0.1693692602 0.0295218745 -0.1638599887 [21] 0.0887292477 -0.2237205568 0.2216712166 0.0515403989 -0.0012430430 [26] -0.0725786219 0.1527449690 -0.0213336908 -0.0298145935 -0.0007697136 [31] 0.0152702492 -0.0698774766 0.0633075865 -0.0675569445 -0.0707207848 [36] -0.1241565197 -0.0993430461 -0.0786432060 0.0398938931 -0.0428133817 [41] 0.0380232924 0.0863839284 -0.0316866415 -0.0688516294 0.0917560380 [46] -0.0099340284 0.1521068231 -0.0441837789 0.0172892039 -0.0755699480 [51] 0.1094818256 0.0205023944 -0.0391095050 0.0302334378 0.0043870726 [56] -0.1028330239 -0.0036403141 0.0350881446 0.0061562632 0.0007237345 > 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/3bu2q1260719916.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/49hbk1260719916.tab") > > try(system("convert tmp/118341260719916.ps tmp/118341260719916.png",intern=TRUE)) character(0) > try(system("convert tmp/2s8pj1260719916.ps tmp/2s8pj1260719916.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.591 0.325 0.722