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 = '1' > 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/1xm3o1244312175.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/2s33w1244312175.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.17395200 0.10225788 -0.17883074 -0.03003181 -0.08454307 [7] 0.25103191 -0.06646724 0.14724513 -0.26566170 0.09381596 -0.17205909 [13] 0.24324134 0.07140085 0.09213908 -0.16218994 -0.09585011 0.04108462 [19] 0.08208724 0.09020734 0.23840335 -0.21788544 0.02350192 -0.07690993 [25] 0.07548271 0.02320764 0.09612431 -0.06154312 -0.15327842 -0.13646058 [31] 0.11315302 -0.06951951 0.20891092 -0.08769224 -0.02843154 -0.12507569 [37] 0.07334915 -0.03385675 0.07038144 -0.08252773 0.11462378 -0.19118012 [43] 0.03604379 -0.01436568 0.16738710 -0.08439574 0.07958035 -0.19416277 [49] -0.03338692 > (mypacf <- c(rpacf$acf)) [1] -0.173952000 0.074245193 -0.154965880 -0.094311692 -0.084625364 [6] 0.220901658 -0.004712909 0.085354401 -0.190665634 0.046480453 [11] -0.091709981 0.139567145 0.151054603 0.029499240 -0.059791051 [16] -0.162933530 0.196621916 -0.006062451 0.097706737 0.178841896 [21] -0.091315510 0.047494421 -0.005133240 0.103652728 -0.107613240 [26] 0.022779740 -0.010773058 -0.145978997 -0.071325790 -0.019733804 [31] -0.054038967 -0.014886313 -0.013067006 -0.038965373 -0.016996911 [36] 0.040130995 -0.123442834 -0.031307463 -0.128143969 0.128196982 [41] -0.006928917 -0.079911028 0.034219259 0.063684150 0.046537529 [46] -0.012916418 -0.008260544 -0.033042389 > 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/3ncfn1244312175.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/46yib1244312175.tab") > > system("convert tmp/1xm3o1244312175.ps tmp/1xm3o1244312175.png") > system("convert tmp/2s33w1244312175.ps tmp/2s33w1244312175.png") > > > proc.time() user system elapsed 0.572 0.315 0.717