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(266433,267722,266003,262971,265521,264676,270223,269508,268457,265814,266680,263018,269285,269829,270911,266844,271244,269907,271296,270157,271322,267179,264101,265518,269419,268714,272482,268351,268175,270674,272764,272599,270333,270846,270491,269160,274027,273784,276663,274525,271344,271115,270798,273911,273985,271917,273338,270601,273547,275363,281229,277793,279913,282500,280041,282166,290304,283519,287816,285226,287595,289741,289148,288301,290155,289648,288225,289351,294735,305333,309030,310215) > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '1' > par1 = '48' > #'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/1ynbw1244312046.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/21r1x1244312046.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.00000000 0.87335638 0.76537699 0.65944562 0.60944169 0.58667178 [7] 0.57314474 0.53618713 0.50000701 0.45588255 0.42587155 0.38378065 [13] 0.35934470 0.32964817 0.28093593 0.24264415 0.18134539 0.16776645 [19] 0.15670971 0.12757383 0.09885817 0.05849584 0.01506208 -0.01028982 [25] -0.02099764 -0.02198990 -0.03944378 -0.05580166 -0.08252166 -0.09752072 [31] -0.08535166 -0.08331321 -0.07779673 -0.10910558 -0.14357303 -0.16524194 [37] -0.18069546 -0.17676921 -0.17754744 -0.18400113 -0.18508613 -0.21197417 [43] -0.22524569 -0.23489889 -0.23025140 -0.24262652 -0.27043962 -0.28884876 [49] -0.29880470 > (mypacf <- c(rpacf$acf)) [1] 0.873356379 0.011066984 -0.047504463 0.173872599 0.113630159 [6] 0.044831842 -0.054534948 0.027275269 -0.015452161 0.018471057 [11] -0.070603338 0.035658324 -0.012343185 -0.121161001 0.017253048 [16] -0.126478975 0.133472962 -0.002886161 -0.124816147 0.026369699 [21] -0.039944813 -0.056452351 0.002213042 0.049512947 0.006855308 [26] -0.048005373 -0.005916433 -0.022561781 0.043928238 0.050571844 [31] -0.027286376 0.010034132 -0.124069897 -0.012519810 -0.011266530 [36] -0.045294730 0.036466470 -0.059917773 -0.006303771 0.036652799 [41] -0.106319990 -0.015758365 0.014814069 0.005967515 -0.121253398 [46] -0.037681652 0.015979429 0.003172664 > 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/3ovqv1244312046.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/4nmya1244312046.tab") > > system("convert tmp/1ynbw1244312046.ps tmp/1ynbw1244312046.png") > system("convert tmp/21r1x1244312046.ps tmp/21r1x1244312046.png") > > > proc.time() user system elapsed 0.579 0.334 0.921