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(54327,53476,52258,50156,47925,45844,47605,63617,67028,65845,60106,55317,53188,51010,49364,47616,45429,43480,44964,61008,64530,62960,57529,52954,51374,49211,47980,45575,44431,43596,45544,60109,63695,60819,54709,49357,46913,46728,44576,41988,40880,37860,38532,52713,56139,50939,46352,42169,42025,41713,40123,37737,36928,33812,36122,48823,51520,47090,42683,39947) > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '1' > 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/16jd71230063530.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/2u8re1230063530.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.784634323 0.425309397 0.147315383 0.022001322 [6] 0.007727782 -0.001026907 -0.014187715 -0.016354528 0.067543786 [11] 0.261936166 0.510569703 0.634271057 0.441137097 0.146717921 [16] -0.068274468 -0.152753760 -0.151979403 -0.161120817 -0.171128822 [21] -0.172653842 -0.106797693 0.039486760 0.217682859 0.298831262 [26] 0.154355532 -0.056882092 -0.192343256 -0.225622930 -0.200073464 [31] -0.196310683 -0.201769689 -0.212993103 -0.184252084 -0.102161784 [36] 0.005800888 0.059590946 -0.030486425 -0.156964631 -0.216137305 [41] -0.207624528 -0.168870551 -0.163621305 -0.165667113 -0.177348647 [46] -0.167969583 -0.127150778 -0.070111062 -0.037161069 -0.069981341 [51] -0.111329623 -0.110997446 -0.073267205 -0.023324662 -0.005684675 [56] 0.001946761 -0.006608665 -0.017112875 -0.018636473 -0.012115944 > (mypacf <- c(rpacf$acf)) [1] 0.7846343232 -0.4952312481 0.1272508912 0.0496244005 0.0138327410 [6] -0.1149198502 0.0703210047 0.0079911094 0.2579085773 0.2710518454 [11] 0.3360909117 -0.0486318969 -0.5290110061 0.2185631614 -0.0677990373 [16] -0.1080243574 -0.0555762517 -0.0333899394 -0.0012266978 -0.1053967503 [21] 0.0018069133 -0.0424481028 -0.0451789260 0.0179057835 0.0050156955 [26] -0.0040832247 0.0332344380 -0.0245404508 0.0278843807 -0.0141165077 [31] -0.0301519746 -0.0758132612 -0.0729916910 -0.0738677255 -0.0360640629 [36] -0.0023237926 -0.0002651077 -0.0191871771 0.0262972932 -0.0479517216 [41] -0.0037614751 -0.0343008947 0.0524292982 -0.0417056313 -0.0002093954 [46] -0.0288286985 -0.0327218525 -0.0224766106 0.1277983124 -0.0393431447 [51] -0.0488507111 0.0682647715 0.0538528599 0.0063129408 0.0069246839 [56] 0.0490331552 -0.0205194615 -0.0386607663 0.0166918845 > 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/3vuwr1230063530.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/455ag1230063530.tab") > > system("convert tmp/16jd71230063530.ps tmp/16jd71230063530.png") > system("convert tmp/2u8re1230063530.ps tmp/2u8re1230063530.png") > > > proc.time() user system elapsed 0.818 0.429 1.126