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(88827,85874,85211,87130,88620,89563,89056,88542,89504,89428,86040,96240,94423,93028,92285,91685,94260,93858,92437,92980,92099,92803,88551,98334,98329,96455,97109,97687,98512,98673,96028,98014,95580,97838,97760,99913,97588,93942,93656,93365,92881,93120,91063,90930,91946,94624,95484,95862,95530,94574,94677,93845,91533,91214,90922,89563,89945,91850,92505,92437) > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '1' > par1 = '36' > #'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/17e4m1229280962.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/2eg2k1229280962.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.757058322 0.626363876 0.519915417 0.439353418 [6] 0.378448780 0.290608902 0.237824389 0.186751714 0.092634457 [11] 0.098650671 0.073061145 0.195435007 0.060931944 -0.007246530 [16] -0.005873875 -0.045305287 -0.064218632 -0.095338780 -0.153158675 [21] -0.169066525 -0.241455046 -0.251381371 -0.321241006 -0.334070842 [26] -0.399667244 -0.437906605 -0.410653486 -0.389685901 -0.349174374 [31] -0.294775108 -0.284273441 -0.240572697 -0.177978273 -0.102622811 [36] -0.066696581 -0.026890216 > (mypacf <- c(rpacf$acf)) [1] 0.75705832 0.12469249 0.02486848 0.02340994 0.02466481 -0.07531161 [7] 0.01264239 -0.01295100 -0.13542993 0.13313420 -0.01448070 0.33637585 [13] -0.47087927 0.05225584 0.04919430 -0.06491536 -0.04222636 -0.02104314 [19] -0.11520812 -0.03684706 0.04627162 -0.17481131 -0.09733663 -0.24672456 [25] 0.13186538 -0.06639612 -0.04338442 0.03970173 0.05530935 -0.02460870 [31] 0.02877515 -0.04213185 0.10659395 0.04123488 0.03067666 0.10825039 > 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/3bm681229280962.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/4sfyp1229280962.tab") > > system("convert tmp/17e4m1229280962.ps tmp/17e4m1229280962.png") > system("convert tmp/2eg2k1229280962.ps tmp/2eg2k1229280962.png") > > > proc.time() user system elapsed 0.542 0.316 0.645