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(103.5,104.6,118.6,106.3,110.7,121.6,107,107.6,125.6,113.5,129.2,130.9,104.7,115.2,124.5,112.3,127.5,120.6,117.5,117.7,120.4,125,131.6,121.1,114.2,112.1,127,116.8,112,129.7,113.6,115.7,119.5,125.8,129.6,128,112.8,101.6,123.9,118.8,109.1,130.6,112.4,111,116.2,119.8,117.2,127.3,107.7,97.5,120.1,110.6,111.3,119.8,105.5,108.7,128.7,119.5,121.1,128.4) > 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/16ls21259943720.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/27d531259943720.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.045507715 -0.137553437 0.302321564 -0.204868994 [6] 0.014118327 0.417145125 -0.138397865 -0.165744843 0.101103926 [11] -0.286897358 -0.020425487 0.469795507 -0.010394767 -0.200810672 [16] -0.006552376 -0.179444189 -0.107684030 0.177775486 -0.085561245 [21] -0.241311505 -0.014685779 -0.158771490 -0.088369416 0.276572862 [26] 0.110885826 -0.235806858 -0.007569796 -0.099537390 -0.198183672 [31] 0.127475535 0.007707631 -0.246041014 -0.038614810 -0.046979314 [36] -0.145448509 0.211684076 0.143963611 -0.192954027 0.059029463 [41] 0.006230694 -0.133269091 0.183465402 0.048960724 -0.141665648 [46] 0.122303654 0.023980517 -0.032762121 0.235476859 0.080986737 [51] -0.022294366 0.104033196 -0.018746285 -0.031013441 0.067409440 [56] -0.032256582 -0.071003731 -0.014998831 -0.045336855 -0.035978083 > (mypacf <- c(rpacf$acf)) [1] 0.045507715 -0.139914145 0.322798820 -0.308569917 0.225655728 [6] 0.233367611 -0.089215940 -0.166141832 -0.047065797 -0.179867409 [11] 0.065463059 0.356206420 0.132588733 -0.245904331 -0.261881755 [16] 0.023084591 -0.146800894 -0.111923773 0.006706251 0.006298030 [21] 0.021588158 0.043560860 0.041186522 -0.070167397 0.048183188 [26] -0.168351014 0.013381185 -0.184869790 -0.103182956 -0.139228832 [31] 0.105211715 -0.011469368 -0.047208155 0.037332498 -0.050780175 [36] -0.072460762 -0.126553357 -0.043517555 0.013301443 0.008523396 [41] 0.080292467 0.082831182 -0.139773621 -0.023069040 0.135175477 [46] -0.026804265 -0.005415994 -0.088556819 -0.016362983 0.012889255 [51] 0.065398166 -0.047559553 0.013614821 -0.101660448 -0.021744646 [56] -0.065493752 -0.121780286 -0.131907063 -0.047202963 > 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/3jv1s1259943720.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/42xbg1259943720.tab") > > system("convert tmp/16ls21259943720.ps tmp/16ls21259943720.png") > system("convert tmp/27d531259943720.ps tmp/27d531259943720.png") > > > proc.time() user system elapsed 0.588 0.304 0.693