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 = '1' > 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/freestat/rcomp/tmp/1fasf1229287085.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/freestat/rcomp/tmp/2vt271229287085.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.264744998 -0.082175105 -0.287582249 -0.310465950 [6] -0.096158717 -0.008837215 -0.047457519 -0.234525312 -0.185642067 [11] -0.050940116 0.247351157 0.782056528 0.163471268 -0.079550104 [16] -0.237379987 -0.231324593 -0.082123153 -0.002614845 -0.037836135 [21] -0.184560473 -0.137499056 -0.033888341 0.196620292 0.592937459 [26] 0.123232052 -0.061012495 -0.201315391 -0.191725803 -0.068656788 [31] -0.005701661 -0.015685823 -0.133432393 -0.100830559 -0.030281309 [36] 0.142004456 0.449794370 0.100497396 -0.038660630 -0.162277198 [41] -0.154366633 -0.080837553 -0.018869421 -0.003681454 -0.080540911 [46] -0.055240681 -0.013431618 0.106002619 0.312270248 0.057698518 [51] -0.024089516 -0.131276217 -0.112375841 -0.068835535 -0.006657297 [56] 0.006913958 -0.042603133 -0.015942814 0.003444065 0.073225715 [61] 0.156152006 > (mypacf <- c(rpacf$acf)) [1] 0.264744998 -0.163741657 -0.241900635 -0.207205126 -0.024265389 [6] -0.107551195 -0.194396698 -0.376406944 -0.276249074 -0.315940772 [11] -0.150130294 0.619921401 -0.312375446 0.060666559 0.174757966 [16] 0.138621310 0.006024164 0.086715120 0.073233618 0.098208877 [21] -0.013684341 0.070140707 -0.061892162 -0.004206981 0.086564910 [26] -0.043437548 -0.089599854 -0.039977103 0.023294409 -0.094039158 [31] -0.022182741 -0.021857615 -0.036839626 -0.064900110 -0.027943614 [36] -0.027567045 -0.026853964 -0.017322947 0.018185301 -0.023196242 [41] -0.090338403 0.010532891 -0.023493293 -0.001530496 -0.006924496 [46] 0.023263112 -0.004302541 -0.079430988 -0.027333237 0.026857164 [51] -0.091174667 -0.016692189 0.006806406 -0.006990027 -0.047177155 [56] 0.016841485 0.070048366 0.013325421 0.013727537 -0.124117137 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/html/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/3rk761229287085.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/freestat/rcomp/tmp/4u8991229287085.tab") > > system("convert tmp/1fasf1229287085.ps tmp/1fasf1229287085.png") > system("convert tmp/2vt271229287085.ps tmp/2vt271229287085.png") > > > proc.time() user system elapsed 0.829 0.414 0.948