R version 2.9.0 (2009-04-17) Copyright (C) 2009 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(581,597,587,536,524,537,536,533,528,516,502,506,518,534,528,478,469,490,493,508,517,514,510,527,542,565,555,499,511,526,532,549,561,557,566,588,620,626,620,573,573,574,580,590,593,597,595,612,628,629,621,569,567,573,584,589,591,595,594,611) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '1' > 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: > 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 (par6 == 'White Noise') par6 <- 'white' else par6 <- 'ma' > par7 <- as.numeric(par7) > 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/1r4op1261394828.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > racf <- acf(x, par1, main='Autocorrelation', xlab='time lag', ylab='ACF', ci.type=par6, ci=par7, sub=paste('(lambda=',par2,', d=',par3,', D=',par4,', CI=', par7, ', CI type=',par6,')',sep='')) > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/2hy6y1261394828.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.240480244 -0.253569473 -0.271351453 -0.173780993 [6] 0.084553222 0.224878438 0.087985331 -0.221611525 -0.275659151 [11] -0.219224280 0.242970370 0.732570488 0.124695375 -0.249413299 [16] -0.244891301 -0.166905185 0.039017378 0.148567669 0.039908286 [21] -0.232468521 -0.249982438 -0.167542167 0.193498237 0.511704213 [26] 0.050092572 -0.223414579 -0.153089414 -0.105791913 0.033514167 [31] 0.098042373 0.026700969 -0.193301533 -0.165037313 -0.064353839 [36] 0.141574534 0.294180838 0.038653805 -0.114280738 -0.087873039 [41] -0.033212528 0.032198709 0.062131889 0.019410119 -0.083382591 [46] -0.065933830 -0.018747537 0.065791591 0.141882179 0.017622875 [51] -0.066471840 -0.037474805 -0.014060611 -0.002393870 0.004844442 [56] -0.006961317 -0.038168839 -0.009629917 0.012509527 > (mypacf <- c(rpacf$acf)) [1] 2.404802e-01 -3.305141e-01 -1.319476e-01 -1.699717e-01 7.053068e-02 [6] 7.983557e-02 -5.163297e-03 -2.046006e-01 -1.219312e-01 -2.452904e-01 [11] 2.538042e-01 5.976182e-01 -1.914356e-01 5.917097e-02 -1.991247e-02 [16] -1.035792e-01 -8.736153e-02 -1.729654e-01 -5.221010e-02 -3.559830e-02 [21] -2.673984e-02 -1.190897e-02 -1.078811e-01 -4.290309e-02 -4.514217e-02 [26] -7.292823e-02 1.052063e-01 -2.018125e-02 2.882035e-02 -3.419846e-02 [31] 2.661706e-03 -8.703487e-03 2.312622e-02 3.865859e-02 -8.652962e-02 [36] -1.612322e-01 1.202073e-01 -2.599955e-05 -9.305634e-02 7.855688e-02 [41] -5.360883e-02 3.955382e-02 -8.992934e-03 1.100430e-01 1.666772e-02 [46] -4.651586e-02 1.535527e-02 -2.759545e-02 -7.980692e-02 -2.675590e-02 [51] -4.733483e-02 -5.636879e-02 -7.248581e-03 -5.110617e-02 -3.986463e-02 [56] -8.868920e-02 2.113939e-02 1.060008e-02 > 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/38mfl1261394828.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/4l9zd1261394828.tab") > > try(system("convert tmp/1r4op1261394828.ps tmp/1r4op1261394828.png",intern=TRUE)) character(0) > try(system("convert tmp/2hy6y1261394828.ps tmp/2hy6y1261394828.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.588 0.302 0.727