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(102.5,77.7,82.8,77.3,103.1,99.7,99.5,107.2,96.7,97.1,105.2,151.2,102.7,75.4,87.2,83.7,105.8,111.5,99.7,111.2,101.5,110.9,116.3,164.9,118.1,83.7,84,107.2,113.7,120.7,111.2,112.4,112.5,130.4,130.7,174.3,132.2,91.8,104.2,104.8,131.4,141.2,132.7,135.7,136.9,151.2,144,201.5,149.6,108.7,122.8,126.7,139.9,162.5,142.7,151.6,148.1,159,157.8,226.7,153.7,122.3,117.6,166,154.5,183.9,164.4,173.3,160.2,166.4,170.3,238.4,166.8,122.5,141.8,140.5,173.8,188.8,168,187.4,177.7,183.8,196.1,264.6,193.7,141.3,170.1,163.7,190.1,230.7,195.9,210.3,204.7,210.3,221.2,288.2,203.2,162.4,149.2,195.3,213.7,227.9,212.1,226.8,212.6,220.9,228.1,311.6) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '0' > 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/1rwrx1259865727.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/2zyor1259865727.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.742286325 0.595668216 0.530685514 0.549134705 [6] 0.570394021 0.621774769 0.532633263 0.467536982 0.411467698 [11] 0.452092383 0.577539542 0.740936252 0.529335021 0.385523221 [16] 0.328089011 0.336622802 0.356597786 0.398239385 0.307552763 [21] 0.249962837 0.215174327 0.223237805 0.345293903 0.474071138 [26] 0.287271729 0.168522555 0.111387759 0.120452132 0.137467965 [31] 0.172160241 0.103801519 0.053754021 0.016568782 0.036347360 [36] 0.132114037 0.259280464 0.089954357 -0.002907291 -0.054329589 [41] -0.045631817 -0.032533442 -0.001837024 -0.059831229 -0.088374780 [46] -0.139610698 -0.111833981 -0.031617027 0.066062332 > (mypacf <- c(rpacf$acf)) [1] 0.7422863249 0.0995058626 0.1319591757 0.2213628733 0.1574511322 [6] 0.2375835281 -0.1189637363 0.0004337476 -0.0537401264 0.1179506228 [11] 0.3226381062 0.4513747649 -0.5132686683 -0.2702935010 -0.0861019398 [16] -0.0565437479 0.0033325335 0.0118980488 -0.0021709735 0.1111604196 [21] 0.1402493464 -0.1949703799 -0.0305566585 0.0795329493 -0.1244974612 [26] 0.0200327643 -0.1002396569 -0.0025688062 0.0141686321 0.0022654236 [31] 0.0515866776 -0.0126670486 -0.0569665440 0.0860107385 -0.1156946454 [36] 0.0963753385 -0.0791688642 -0.0081562859 -0.0019593404 -0.0030996914 [41] -0.0509359125 -0.0663275475 0.0418890373 0.0305931730 -0.0751687970 [46] 0.0395174228 -0.0741806940 -0.0560413916 > 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/3b4ig1259865727.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/4xjes1259865727.tab") > > system("convert tmp/1rwrx1259865727.ps tmp/1rwrx1259865727.png") > system("convert tmp/2zyor1259865727.ps tmp/2zyor1259865727.png") > > > proc.time() user system elapsed 0.598 0.322 0.817