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(519,517,510,509,501,507,569,580,578,565,547,555,562,561,555,544,537,543,594,611,613,611,594,595,591,589,584,573,567,569,621,629,628,612,595,597,593,590,580,574,573,573,620,626,620,588,566,557,561,549,532,526,511,499,555,565,542,527,510,514,517,508,493,490,469,478,528,534,518) > par5 = '12' > par4 = '1' > 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: 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/freestat/rcomp/tmp/1f5xp1229698653.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/freestat/rcomp/tmp/2560a1229698653.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.063320468 0.044378229 0.112960669 0.053361734 [6] -0.072957058 0.079715963 0.007447751 0.088769079 -0.020800137 [11] -0.124907535 0.165949484 -0.284330090 -0.148460192 0.088908493 [16] -0.054186648 -0.137630168 0.001238375 0.028037907 0.046243107 [21] 0.036025433 -0.017726143 0.026872489 0.022180891 -0.149428154 [26] -0.035255596 -0.105740685 0.031767759 -0.045303640 0.089929046 [31] -0.075425681 -0.041857779 -0.062924123 -0.039021497 -0.032018379 [36] -0.017406199 -0.041471187 0.024476729 0.169824487 -0.073254054 [41] 0.021534404 -0.010332417 -0.039479039 0.009874589 0.031196238 [46] -0.004970427 0.051692399 -0.054514051 0.019433822 0.056375200 [51] -0.087260768 0.025230406 0.024254986 -0.026647878 0.003551903 [56] 0.005398422 > (mypacf <- c(rpacf$acf)) [1] -0.0633204680 0.0405312563 0.1188945224 0.0675081219 -0.0771220154 [6] 0.0514384639 0.0100584726 0.1007677990 -0.0174223104 -0.1584690924 [11] 0.1457131273 -0.2830520241 -0.1568769576 0.0821380705 -0.0212611965 [16] -0.0556665419 -0.0753334270 0.0899709927 0.1133696148 0.0864177009 [21] 0.0291894988 -0.1148479496 0.0951906107 -0.1886478083 -0.2234683195 [26] -0.1563754796 0.0621016443 -0.0477735091 0.0358048912 0.0139569376 [31] 0.0227029454 0.0693986390 -0.0002828990 -0.0625950952 0.0451623739 [36] -0.1145261842 -0.1385260466 0.0653643383 -0.0099196595 -0.0717647555 [41] -0.0759399733 -0.0450337866 0.0626395301 0.1054952957 0.0586994878 [46] -0.0149738931 -0.0282208573 -0.0100210031 -0.1074395211 -0.0796938170 [51] 0.0309983113 -0.1250219277 0.0043140983 0.0172129804 0.0369747727 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/html/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/3kopq1229698653.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/freestat/rcomp/tmp/4hpjp1229698653.tab") > > system("convert tmp/1f5xp1229698653.ps tmp/1f5xp1229698653.png") > system("convert tmp/2560a1229698653.ps tmp/2560a1229698653.png") > > > proc.time() user system elapsed 0.825 0.431 0.937