R version 2.7.0 (2008-04-22) 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(58.972,59.249,63.955,53.785,52.760,44.795,37.348,32.370,32.717,40.974,33.591,21.124,58.608,46.865,51.378,46.235,47.206,45.382,41.227,33.795,31.295,42.625,33.625,21.538,56.421,53.152,53.536,52.408,41.454,38.271,35.306,26.414,31.917,38.030,27.534,18.387,50.556,43.901,48.572,43.899,37.532,40.357,35.489,29.027,34.485,42.598,30.306,26.451,47.460,50.104,61.465,53.726,39.477,43.895,31.481,29.896,33.842,39.120,33.702,25.094) > 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/1qggg1228483110.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/2a13y1228483110.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.0000000000 0.4585916649 0.2103955698 0.1033124890 -0.1257759826 [6] -0.2738507666 -0.3624724978 -0.3285287144 -0.1751491013 -0.0410320117 [11] -0.0003882145 0.2064231066 0.6498915017 0.2627499392 0.0996403784 [16] 0.0313557875 -0.1462566089 -0.2079869068 -0.2992451929 -0.2760265872 [21] -0.1043835282 -0.0128127244 0.0276263567 0.2218408991 0.5488414681 [26] 0.2656823944 0.1276646897 0.0072468997 -0.1364434773 -0.1809944815 [31] -0.2792418031 -0.2465846886 -0.1203508342 -0.0748867660 -0.0513097838 [36] 0.0625308696 0.2729053484 > (mypacf <- c(rpacf$acf)) [1] 0.4585916649 0.0001130244 0.0085930884 -0.2232476716 -0.1818237397 [6] -0.1987391997 -0.0721143791 0.0519434377 0.0488338956 -0.0768739682 [11] 0.1494757854 0.6023906548 -0.4797219424 -0.1111962345 -0.0516525547 [16] 0.0600655771 0.0637510040 -0.0305783401 -0.0143232140 0.0074276868 [21] 0.0601947044 0.1243218124 0.0914949419 -0.0614424671 0.0107079172 [26] -0.0034736242 -0.0927546832 0.0797409712 -0.0350726033 0.0331331223 [31] 0.0406532543 -0.1231794212 -0.0259953206 -0.0610931398 -0.1676418930 [36] -0.1333581200 > 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/3jg6o1228483110.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/4c97i1228483110.tab") > > system("convert tmp/1qggg1228483110.ps tmp/1qggg1228483110.png") > system("convert tmp/2a13y1228483110.ps tmp/2a13y1228483110.png") > > > proc.time() user system elapsed 1.465 0.554 1.567