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(9.0,9.1,8.7,8.2,7.9,7.9,9.1,9.4,9.5,9.1,9.0,9.3,9.9,9.8,9.4,8.3,8.0,8.5,10.4,11.1,10.9,9.9,9.2,9.2,9.5,9.6,9.5,9.1,8.9,9.0,10.1,10.3,10.2,9.6,9.2,9.3,9.4,9.4,9.2,9.0,9.0,9.0,9.8,10.0,9.9,9.3,9.0,9.0,9.1,9.1,9.1,9.2,8.8,8.3,8.4,8.1,7.8,7.9,7.9,8.0,7.9,7.5,7.2,6.9,6.6,6.7,7.3,7.5) > par5 = '12' > par4 = '1' > par3 = '2' > par2 = '0.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/1hfpf1229092977.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/2ybf51229092977.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.158166729 -0.116558851 -0.401527023 -0.346865167 [6] -0.158684095 0.092046868 0.192481896 0.243018292 0.115048793 [11] -0.072057555 -0.016927793 -0.199394255 -0.100743528 0.083093388 [16] 0.012683422 0.050561988 0.023472522 0.038461300 -0.031395540 [21] -0.080259132 -0.063559787 0.003070279 0.085719334 0.066282404 [26] 0.074076420 0.063211001 -0.140506747 -0.189287837 -0.136509174 [31] 0.094237578 0.066332378 0.258941521 0.101777827 0.049437946 [36] -0.213664572 -0.284393263 -0.059871339 0.041136221 0.147149525 [41] 0.164089828 0.085830586 -0.116840211 0.004034063 -0.113157333 [46] -0.065782147 -0.010287776 0.018565298 0.118243481 0.007732623 [51] -0.060188683 0.012626341 0.010486503 -0.003554549 > (mypacf <- c(rpacf$acf)) [1] 0.158166729 -0.145208197 -0.374515581 -0.299496402 -0.248815725 [6] -0.173676847 -0.172186719 -0.055201863 -0.036729908 -0.085083474 [11] 0.163083956 -0.062953902 0.002727924 0.194680248 -0.052218179 [16] -0.007301495 0.001234858 0.036104362 -0.075447914 -0.131642152 [21] -0.067601507 -0.149254928 0.001332856 -0.024245111 -0.014656654 [26] 0.240906062 -0.026516809 -0.067411286 -0.050497997 0.064350681 [31] -0.197482577 0.035372913 0.049785151 0.053992820 -0.031892225 [36] -0.106827652 0.056099590 0.017304663 -0.031148988 -0.055754996 [41] -0.031846680 -0.071683440 0.064346861 -0.096672915 -0.044018090 [46] 0.001024855 -0.015793970 -0.036744190 -0.065030678 -0.058951916 [51] -0.017249549 -0.030548385 0.031347057 > 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/3hvr31229092977.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/4xi9j1229092977.tab") > > system("convert tmp/1hfpf1229092977.ps tmp/1hfpf1229092977.png") > system("convert tmp/2ybf51229092977.ps tmp/2ybf51229092977.png") > > > proc.time() user system elapsed 0.592 0.304 0.711