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(1190.8,728.8,995.6,1260.3,994,957.3,975.6,884.9,908.4,1022.8,958.6,825.1,1116.6,724.2,1004.5,1058.9,854.7,943.4,792.4,873.2,1101.4,987.1,1038.8,1060.7,1047.7,840,1044,1097.4,987.5,934,977,881.1,1083.3,1074.7,1182.2,1117.5,1117.4,936.2,1246.3,1175.1,1177.7,1035.8,1091.6,998.7,1247.9,1034.7,1287.7,994.0,1122.8,1017.3,1106.0,1191.8,1030.1,989.4,979.6,1088.0,1389.2,1043.9,1182.1,1109.6,1463.3,1276.2,1082.4,1360.4,1130.2,1019.6,1077.0,958.8,959.6,907.2,880.8,759.6,1137.2) > 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/rcomp/tmp/1gyq21228410942.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/2rfmn1228410942.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.216800399 0.273785371 0.271518843 0.225735378 [6] 0.217325627 0.218876779 0.038350931 0.016975166 -0.007671918 [11] 0.051115157 -0.048694810 0.354146625 -0.067384137 0.062079958 [16] -0.020854132 0.077767411 0.152933788 0.119850132 -0.061863135 [21] 0.032980895 -0.023385480 0.025232092 -0.028677926 0.126864240 [26] -0.135087170 -0.060916352 -0.134822837 -0.073372553 -0.093909967 [31] -0.100403175 -0.219569221 -0.146426338 -0.214609040 -0.062630398 [36] -0.172956307 0.007485671 -0.141908867 -0.138748570 -0.076031132 [41] -0.033059093 -0.039583308 -0.118287879 -0.149231498 -0.100965995 [46] -0.190010178 -0.003293285 -0.184343624 -0.046169032 -0.097510622 [51] -0.149690617 -0.015677317 -0.005465714 0.006669416 -0.043058051 [56] -0.075815239 -0.006083572 0.049908264 0.070233051 -0.093157663 [61] 0.105138541 > (mypacf <- c(rpacf$acf)) [1] 0.216800399 0.237968029 0.194315452 0.109749666 0.084363972 [6] 0.083256671 -0.132116895 -0.129557346 -0.096247718 0.044819477 [11] -0.044890543 0.480188649 -0.105259099 0.015726797 -0.237809975 [16] -0.005152670 0.075049527 0.067029104 -0.055951289 0.058642295 [21] -0.021974964 -0.075488679 -0.008178035 -0.034553956 0.008573528 [26] -0.115349063 -0.018718918 -0.093475459 -0.117746181 -0.089219128 [31] 0.031113648 0.012348637 -0.051921796 0.062340440 -0.104643601 [36] 0.127376750 -0.068631251 -0.089620058 0.022818045 -0.015815194 [41] 0.050628831 -0.163267310 0.042466148 -0.082090591 0.021407873 [46] 0.039579281 0.025115718 -0.029390500 0.042414237 -0.063538295 [51] 0.040964728 0.018384516 -0.021557961 0.035207584 -0.064804684 [56] 0.021354118 0.113464145 -0.049322277 -0.055379503 0.096165621 > 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/3ecrj1228410942.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/40g2b1228410942.tab") > > system("convert tmp/1gyq21228410942.ps tmp/1gyq21228410942.png") > system("convert tmp/2rfmn1228410942.ps tmp/2rfmn1228410942.png") > > > proc.time() user system elapsed 0.610 0.332 1.202