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(121.6,118.8,114.0,111.5,97.2,102.5,113.4,109.8,104.9,126.1,80.0,96.8,117.2,112.3,117.3,111.1,102.2,104.3,122.9,107.6,121.3,131.5,89.0,104.4,128.9,135.9,133.3,121.3,120.5,120.4,137.9,126.1,133.2,151.1,105.0,119.0,140.4,156.6,137.1,122.7,125.8,139.3,134.9,149.2,132.3,149.0,117.2,119.6,152.0,149.4,127.3,114.1,102.1,107.7,104.4,102.1,96.0,109.3,90.0,83.9) > 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/1g91m1259607006.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/27f5r1259607006.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.514089390 0.286352827 0.339560805 0.327068741 [6] 0.384159940 0.399257479 0.259675142 0.101437469 -0.013222590 [11] -0.122561124 0.027485314 0.335010278 -0.010601800 -0.256962997 [16] -0.158708106 -0.130945631 -0.063386056 -0.048742369 -0.118147117 [21] -0.221248831 -0.280310101 -0.306574975 -0.196203533 -0.001256664 [26] -0.195870452 -0.402158390 -0.282134095 -0.217902684 -0.188855597 [31] -0.125673493 -0.166988270 -0.212468990 -0.226376618 -0.158772531 [36] -0.114699207 0.038475609 -0.047907336 -0.171363154 -0.071759231 [41] -0.026006847 -0.009495518 0.071179951 0.046248644 0.017616844 [46] 0.037329964 0.063268463 0.081782272 0.164177081 0.125280488 [51] 0.062243494 0.092393431 0.069812138 0.059728909 0.073355758 [56] 0.053207194 0.018429901 0.008019265 -0.004143043 -0.005199440 > (mypacf <- c(rpacf$acf)) [1] 0.514089390 0.029991250 0.246713321 0.087005746 0.228013030 [6] 0.126404691 -0.055645602 -0.171624363 -0.241125642 -0.322286134 [11] 0.063175454 0.540670809 -0.229462562 -0.229358735 0.008562988 [16] 0.022861525 -0.050682878 -0.192760467 -0.024498675 -0.021352005 [21] 0.050845440 0.068846548 -0.125291856 -0.196274373 0.020943920 [26] 0.034501019 -0.016172669 -0.109123496 -0.111730546 0.145955031 [31] 0.036514709 -0.008158637 -0.140486562 0.060151345 -0.095256546 [36] 0.023822862 -0.036290844 0.035148195 -0.063981146 -0.084935318 [41] 0.065297843 0.056170687 0.017471155 -0.005282248 0.053620068 [46] -0.137097836 0.011236968 0.014297661 -0.070647413 -0.037729507 [51] -0.062841855 0.036080022 -0.034441923 -0.145842687 -0.049129041 [56] 0.051179144 -0.013578986 0.010021501 0.037140794 > 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/3l0mb1259607006.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/45muj1259607006.tab") > > system("convert tmp/1g91m1259607006.ps tmp/1g91m1259607006.png") > system("convert tmp/27f5r1259607006.ps tmp/27f5r1259607006.png") > > > proc.time() user system elapsed 0.586 0.324 0.711