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(16,17,23,24,27,31,40,47,43,60,64,65,65,55,57,57,57,65,69,70,71,71,73,68,65,57,41,21,21,17,9,11,6,-2,0,5,3,7,4,8,9,14,12,12,7,15,14,19,39,12,11,17,16,25,24,28,25,31,24,24) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '1' > 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/1rl9g1293620572.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/2rl9g1293620572.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.000000000 0.061300839 0.198398369 0.420397631 0.003998418 [6] 0.085896636 0.182414738 0.023024741 0.022223463 0.035523894 [11] -0.147105240 -0.089968291 -0.247109787 -0.045263756 -0.053791365 [16] -0.130796471 -0.044225442 0.038889558 -0.223191237 -0.051024494 [21] 0.007208945 -0.192159030 -0.009730609 0.036917961 -0.171124786 [26] -0.037932060 -0.080996830 -0.126846779 0.112520534 -0.108675481 [31] 0.009124729 0.062231956 -0.074950624 0.026351325 -0.034146267 [36] -0.035396320 0.075575109 0.001156243 0.004879726 0.001219242 [41] -0.005670570 -0.008933170 -0.014832901 -0.003822609 0.005758080 [46] 0.013788877 0.008893106 > (mypacf <- c(rpacf$acf)) [1] 0.061300839 0.195374754 0.416018767 -0.053965460 -0.089141902 [6] 0.022996515 0.058543457 -0.026370382 -0.078168930 -0.203840849 [11] -0.098572297 -0.242718108 0.131345081 0.148316002 0.075861860 [16] -0.100718464 0.098012479 -0.150282370 -0.037249900 -0.035740048 [21] -0.066758737 -0.137832902 0.032118502 -0.113392313 0.046139777 [26] -0.109368822 0.072510092 0.213746105 0.008800252 -0.138445469 [31] -0.061557010 -0.047409947 0.009066151 -0.174617780 0.011031382 [36] -0.034349213 0.012667875 0.046675153 0.016804836 0.062634825 [41] 0.014518555 -0.065617230 -0.027478118 -0.103722378 -0.105870228 [46] -0.001475563 > 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/3ump41293620572.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/4g5os1293620572.tab") > > try(system("convert tmp/1rl9g1293620572.ps tmp/1rl9g1293620572.png",intern=TRUE)) character(0) > try(system("convert tmp/2rl9g1293620572.ps tmp/2rl9g1293620572.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.575 0.312 27.110