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(118.3,127.3,112.3,114.9,108.2,105.4,122.1,113.5,110,125.3,114.3,115.6,127.1,123,122.2,126.4,112.7,105.8,120.9,116.3,115.7,127.9,108.3,121.1,128.6,123.1,127.7,126.6,118.4,110,129.6,115.8,125.9,128.4,114,125.6,128.5,136.6,133.1,124.6,123.5,117.2,135.5,124.8,127.8,133.1,125.7,128.4,131.9,146.3,140.6,129.5,132.4,125.9,126.9,135.8,129.5,130.2,133.8,123.3,140.6) > 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/1wubr1229356599.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/2fafl1229356599.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.40279553 0.39258611 0.45761206 0.17242359 0.37376772 [7] 0.40874582 0.24577580 0.15650093 0.25909302 0.17237190 0.27184904 [13] 0.49255801 0.19217719 0.16852870 0.15907749 -0.01985350 0.10141720 [19] 0.14531788 -0.02657574 -0.06800111 -0.05613829 -0.03300136 0.03660449 [25] 0.07875168 -0.01886635 -0.09600951 -0.10697097 -0.15042750 -0.13299338 [31] -0.12715829 -0.15894477 -0.22919821 -0.24001699 -0.15054814 -0.18682039 [37] -0.08855784 -0.11796417 -0.24698548 -0.16679182 -0.21243295 -0.21381686 [43] -0.21132521 -0.18845108 -0.23202421 -0.21999844 -0.17004958 -0.20897799 [49] -0.12839332 -0.12131132 -0.17345126 -0.08880123 -0.13162823 -0.13430622 [55] -0.05679346 -0.10614184 -0.07945285 -0.03004634 -0.05213041 0.01271855 [61] -0.01931612 > (mypacf <- c(rpacf$acf)) [1] 0.4027955292 0.2749511057 0.2998485277 -0.1671891746 0.2405046456 [6] 0.2121241529 -0.0008906135 -0.2978915558 0.1751515347 0.1011609084 [11] 0.1427496073 0.2553655853 -0.1089323881 -0.2126946808 -0.1579439907 [16] -0.0924932316 -0.0929769494 0.0185838021 -0.0304551624 -0.0604570206 [21] -0.0807591908 0.1903806797 0.0038334072 -0.1706703160 -0.0470610966 [26] 0.0377683078 -0.0545787171 -0.0349241248 -0.0443393746 -0.0798885781 [31] 0.0942781753 0.0454882967 -0.0991939280 -0.0437819412 -0.0510452130 [36] 0.0657165915 -0.0160833799 -0.0422836425 0.0420243476 -0.0628768014 [41] -0.0147579677 -0.0743617688 0.0671119350 0.0404246640 -0.0091664556 [46] -0.1333960824 0.0342486610 -0.0036275844 -0.0177420284 -0.0179798952 [51] 0.1420014606 0.0271169054 -0.0258640585 0.0558257250 -0.0386540334 [56] -0.0135217883 0.0532861698 0.0190470555 0.0563285853 -0.0376086928 > 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/39k1p1229356599.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/4q9qq1229356599.tab") > > system("convert tmp/1wubr1229356599.ps tmp/1wubr1229356599.png") > system("convert tmp/2fafl1229356599.ps tmp/2fafl1229356599.png") > > > proc.time() user system elapsed 0.647 0.344 0.917