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(13807.9,14101.7,16010.3,14633.1,14478.5,15327.3,14179.5,11398.2,16111.5,15887.4,14529.3,13923.1,13960.2,14807.8,17511.5,15845.9,14594.2,17252.2,14832.8,13132.1,17665.9,16913,17318.8,16224.2,15469.6,16557.5,19414.8,17335,16525.2,18160.4,15553.8,15262.2,18581,17564.1,18948.6,17187.8,17564.8,17668.4,20811.7,17257.8,18984.2,20532.6,17082.3,16894.9,20274.9,20078.6,19900.9,17012.2,19642.9,19024,21691,18835.9,19873.4,21468.2,19406.8,18385.3,20739.3,22268.3,21569,17514.8) > par5 = '12' > par4 = '0' > par3 = '0' > 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/1fdw51229016245.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/2qgjn1229016245.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.62519773 0.48946319 0.57908866 0.57612354 0.52719639 [7] 0.57352854 0.45465269 0.42308278 0.38358833 0.23836668 0.29996968 [13] 0.51113069 0.22033993 0.13416561 0.16538490 0.15598304 0.13014224 [19] 0.17596714 0.06833975 0.03623597 -0.01372162 -0.11971964 -0.01761105 [25] 0.07731284 -0.13314617 -0.17041851 -0.14698045 -0.14151608 -0.16416371 [31] -0.12201274 -0.17916633 -0.19052119 -0.26031607 -0.33508201 -0.23820135 [37] -0.17120135 -0.30068672 -0.34480437 -0.30853684 -0.28514634 -0.29755952 [43] -0.25910445 -0.27619605 -0.27751144 -0.30875037 -0.31437092 -0.26066052 [49] -0.21774798 > (mypacf <- c(rpacf$acf)) [1] 0.625197731 0.161856000 0.373274185 0.177876030 0.123143809 [6] 0.209078702 -0.144185549 0.019118095 -0.171111812 -0.317673121 [11] 0.076729869 0.419475842 -0.343997845 0.050944453 -0.184387808 [16] 0.023031714 0.028869482 0.004774633 0.023987197 -0.089592153 [21] -0.135574738 -0.022692220 0.097668667 -0.121082809 0.034299133 [26] -0.057411570 0.027910573 0.067990989 -0.103457658 0.016655042 [31] 0.009499469 -0.069284693 -0.053480032 -0.113763321 -0.148936172 [36] 0.090070177 -0.015883480 -0.015875188 0.124337809 -0.055014660 [41] 0.048857947 0.004234899 -0.068236979 -0.033111975 0.020268723 [46] -0.017833593 -0.054668446 -0.094908923 > 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/3mmy71229016245.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/4573n1229016245.tab") > > system("convert tmp/1fdw51229016245.ps tmp/1fdw51229016245.png") > system("convert tmp/2qgjn1229016245.ps tmp/2qgjn1229016245.png") > > > proc.time() user system elapsed 1.520 0.565 1.612