R version 2.8.0 (2008-10-20) Copyright (C) 2008 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(88900,87280,85519,83647,81616,80100,94027,102327,104296,101593,94816,93535,93618,92330,90751,88576,86102,85494,103432,108870,109713,106960,103195,102348,102158,100431,97649,95611,93035,93579,111777,116065,116609,112934,107660,107965,107772,106201,102288,99217,96511,96456,113021,117836,118492,113922,109317,107496,105524,103824,101833,99436,96915,96072,111941,116008,117557,113445,108762,106661,102824,101912,99005,97894,96256,95606,108948,111223,113142,106078,100992,97413) > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '-2.0' > 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: Write here your technical program description (don't use hard returns!) > 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 (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/1orh11229286842.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > racf <- acf(x,par1,main='Autocorrelation',xlab='lags',ylab='ACF') > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/2ho2n1229286842.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.816671787 0.540412874 0.287992373 0.128265379 [6] 0.064910386 0.026779910 0.028593319 0.064430427 0.183990951 [11] 0.361893467 0.543793768 0.639171270 0.471614236 0.245964961 [16] 0.044092649 -0.083035587 -0.140537211 -0.174102799 -0.169830334 [21] -0.143100818 -0.051395156 0.083537248 0.224179898 0.297341475 [26] 0.170311377 -0.001292174 -0.156901700 -0.248188418 -0.281544416 [31] -0.292241514 -0.273257503 -0.242899547 -0.165273758 -0.057004736 [36] 0.055106438 0.120172029 0.032870697 -0.091205624 -0.207668388 [41] -0.274628923 -0.295822807 -0.291542108 -0.259120418 -0.219171380 [46] -0.149572713 -0.065953236 0.016891973 0.061751143 -0.002190661 [51] -0.088386667 -0.168909919 -0.209157656 -0.217436936 -0.206681132 [56] -0.174415846 -0.138098279 -0.083374182 -0.026951794 0.022578554 [61] 0.044816782 > (mypacf <- c(rpacf$acf)) [1] 0.816671814 -0.379945984 -0.037694457 0.073755207 0.057751789 [6] -0.103024722 0.108525480 0.082215274 0.286033236 0.222908776 [11] 0.243631082 0.060916659 -0.578833415 0.176668622 -0.052260652 [16] -0.114163378 -0.079537819 0.051626145 -0.061709087 -0.127927703 [21] -0.011828507 0.033457979 -0.003255002 0.001779932 -0.059407075 [26] -0.003068234 -0.038357183 0.004517630 0.009721447 -0.002665281 [31] -0.017795352 -0.011287301 -0.026309738 -0.018046220 -0.023159201 [36] 0.049783586 -0.031666646 -0.024539854 -0.016502447 -0.025833006 [41] -0.031501113 0.018896686 0.012771329 0.004302232 -0.039429700 [46] -0.024222456 -0.024201527 -0.048172353 0.028745356 0.022587221 [51] -0.008354376 0.002310645 -0.015154414 -0.027112049 -0.019633496 [56] 0.008794252 -0.007023433 -0.040056985 -0.043710865 -0.005749721 > 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/3vc4c1229286842.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/4w8pm1229286842.tab") > > system("convert tmp/1orh11229286842.ps tmp/1orh11229286842.png") > system("convert tmp/2ho2n1229286842.ps tmp/2ho2n1229286842.png") > > > proc.time() user system elapsed 0.595 0.319 0.694