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(96.2,96.8,109.9,88,91.1,106.4,68.6,100.1,108,106,108.6,91.5,99.2,98,96.6,102.8,96.9,110,70.5,101.9,109.6,107.8,113,93.8,108,102.8,116.3,89.2,106.7,112.1,74.2,108.8,111.5,118.8,118.9,97.6,116.4,107.9,121.2,97.9,113.4,117.6,79.6,115.9,115.7,129.1,123.3,96.7,121.2,118.2,102.1,125.4,116.7,121.3,85.3,114.2,124.4,131,118.3,99.6) > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '0.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/17yfw1259954407.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/28kid1259954407.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.027325161 0.094227974 0.137230282 0.011753161 [6] 0.337490000 -0.007813336 0.273663635 0.059788816 0.048629486 [11] 0.025981794 0.022847601 0.641480738 -0.023064704 0.006364063 [16] 0.041912780 -0.100979447 0.181388535 -0.095907349 0.105483583 [21] -0.046565128 -0.026730044 -0.116090360 -0.033376175 0.365672666 [26] -0.129442289 -0.069749266 -0.088813301 -0.167561707 0.050033242 [31] -0.156987702 -0.009217334 -0.101126886 -0.127899518 -0.144410301 [36] -0.111039132 0.189440922 -0.162091603 -0.100236755 -0.145388482 [41] -0.167434309 -0.002029412 -0.129253907 -0.056789303 -0.059259770 [46] -0.169314082 -0.087759045 -0.062345084 0.028178858 -0.069937271 [51] -0.071955401 -0.080794022 -0.100457644 -0.026686545 -0.033416158 [56] -0.021590602 -0.016067963 -0.027793708 -0.005501404 0.003983154 > (mypacf <- c(rpacf$acf)) [1] 0.0273251613 0.0935511610 0.1336082644 -0.0021430128 0.3211260295 [6] -0.0405591711 0.2617681430 -0.0399842752 0.0594790110 -0.1830769526 [11] 0.0752115401 0.5685264120 -0.0729522806 -0.1789543689 -0.1265238144 [16] -0.1270704721 -0.1516139692 -0.0724129785 -0.0720502264 -0.1200487279 [21] 0.1166067091 -0.0766039759 0.0406245897 0.0101957121 -0.0149912468 [26] -0.0764627386 -0.0223136577 -0.0360923141 -0.0329875237 0.0070385602 [31] -0.0135420185 -0.0035087353 -0.0837860440 0.0518954432 -0.1035000772 [36] -0.0254476284 -0.0053553740 0.0198710343 -0.0509134218 0.0549937869 [41] 0.0008382567 0.0416228148 -0.0307595094 0.0672284369 -0.1420377959 [46] 0.0897763415 0.0116324909 -0.1688102746 0.0111209192 0.0939842522 [51] 0.0288678535 -0.0091754748 -0.0291501587 0.0009632916 -0.0164482070 [56] 0.0285397570 0.1234894367 0.0403245739 -0.0464925699 > 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/3s76t1259954407.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/453tl1259954407.tab") > > system("convert tmp/17yfw1259954407.ps tmp/17yfw1259954407.png") > system("convert tmp/28kid1259954407.ps tmp/28kid1259954407.png") > > > proc.time() user system elapsed 0.605 0.340 0.720