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(104.1,90.2,99.2,116.5,98.4,90.6,130.5,107.4,106,196.5,107.8,90.5,123.8,114.7,115.3,197,88.4,93.8,111.3,105.9,123.6,171,97,99.2,126.6,103.4,121.3,129.6,110.8,98.9,122.8,120.9,133.1,203.1,110.2,119.5,135.1,113.9,137.4,157.1,126.4,112.2,128.8,136.8,156.5,215.2,146.7,130.8,133.1,153.4,159.9,174.6,145,112.9,137.8,150.6,162.1,226.4,112.3,126.3) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '0' > 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/1a1uu1260352133.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/2d6il1260352133.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.0000000000 0.1757516359 -0.0002504971 0.1713576122 -0.0769236005 [6] 0.1521997451 0.5887853954 0.0717254282 -0.1119715346 0.0873995662 [11] -0.0515185273 0.1283181127 0.5457369623 0.0222094262 -0.1100656216 [16] 0.0281998986 -0.0969462539 0.0197357947 0.3193763838 -0.0238023453 [21] -0.1683755021 0.0077261908 -0.1181720836 -0.0131932304 0.3554444137 [26] -0.0631568579 -0.1420759660 -0.0674635210 -0.1934929688 -0.0817948261 [31] 0.1418017587 -0.0891342411 -0.2058278580 -0.1060652122 -0.1317580142 [36] -0.0552973315 0.1893937281 -0.0658889799 -0.1795377410 -0.1044302585 [41] -0.1243486965 -0.0856822856 0.0989167032 -0.1334823618 -0.1805694585 [46] -0.1048722909 -0.1074073490 -0.0545663454 0.0573894345 -0.1224382493 [51] -0.0980820772 -0.0462201504 -0.0845459011 -0.0560949560 -0.0444670515 [56] -0.0749585080 -0.0689248826 -0.0285665174 0.0095249517 0.0013769117 > (mypacf <- c(rpacf$acf)) [1] 0.175751636 -0.032131637 0.182882205 -0.150868950 0.227655256 [6] 0.533082026 -0.102308608 -0.231801079 0.014696799 0.107445340 [11] 0.040036413 0.263828753 -0.096298508 -0.042714161 -0.101214451 [16] -0.018836129 -0.160312113 -0.057906315 0.059388709 0.011368706 [21] 0.005219035 -0.079374978 -0.026136054 0.188976222 -0.082933742 [26] -0.027923564 -0.142867228 -0.031761583 -0.048620043 -0.151786148 [31] 0.012534726 -0.019894605 -0.003982459 0.097372461 -0.001607109 [36] 0.017489572 -0.008978518 -0.023519039 0.018579190 -0.011504923 [41] -0.019843056 -0.001757230 -0.158132004 0.068286500 -0.078659304 [46] -0.012211303 -0.043629907 -0.130063404 0.033440889 0.092685088 [51] 0.097727584 -0.033853274 -0.045214065 -0.072032334 0.106991280 [56] -0.034939162 -0.002858798 0.031569887 0.121168154 > 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/3va7n1260352133.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/4m8fi1260352133.tab") > > system("convert tmp/1a1uu1260352133.ps tmp/1a1uu1260352133.png") > system("convert tmp/2d6il1260352133.ps tmp/2d6il1260352133.png") > > > proc.time() user system elapsed 0.584 0.316 0.818