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(7.5,7.2,6.9,6.7,6.4,6.3,6.8,7.3,7.1,7.1,6.8,6.5,6.3,6.1,6.1,6.3,6.3,6,6.2,6.4,6.8,7.5,7.5,7.6,7.6,7.4,7.3,7.1,6.9,6.8,7.5,7.6,7.8,8,8.1,8.2,8.3,8.2,8,7.9,7.6,7.6,8.2,8.3,8.4,8.4,8.4,8.6,8.9,8.8,8.3,7.5,7.2,7.5,8.8,9.3,9.3,8.7,8.2,8.3,8.5,8.6,8.6,8.2,8.1,8,8.6,8.7,8.8,8.5,8.4,8.5,8.7,8.7,8.6,8.5,8.3,8.1,8.2,8.1,8.1,7.9,7.9,7.9,8,8,7.9,8,7.7,7.2,7.5,7.3,7,7,7,7.2,7.3,7.1,6.8,6.6,6.2,6.2,6.8,6.9,6.8,6.7) > 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/1gowd1228666965.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/2ua3j1228666965.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.471504971 -0.079734466 -0.483993925 -0.479356676 [6] -0.116714904 0.161944294 0.276743225 0.268144317 0.159687823 [11] -0.042510816 -0.159931036 -0.244093318 -0.063364924 0.107520126 [16] 0.130252373 0.084793283 -0.055580778 -0.013538821 -0.035499545 [21] 0.027862677 -0.015627745 -0.044206547 -0.014479242 -0.029821887 [26] 0.032744489 0.045465846 -0.006611322 -0.108659170 -0.170998549 [31] -0.188142317 0.061531373 0.309278281 0.347843652 0.149037825 [36] -0.245587723 -0.421439709 -0.343165868 0.042220313 0.278448413 [41] 0.323003564 0.207300694 -0.033098498 -0.190520393 -0.287416193 [46] -0.185350780 -0.008224631 0.183687478 0.206294065 0.135661146 [51] -0.039143676 -0.108268679 -0.083777196 -0.041065054 0.038549157 [56] 0.017677484 -0.013749605 -0.069219586 -0.077567174 -0.004738587 [61] 0.026287201 > (mypacf <- c(rpacf$acf)) [1] 0.471504971 -0.388399103 -0.376555524 -0.118342216 0.106283151 [6] -0.092036380 -0.011907821 0.184002665 0.149880184 -0.077309546 [11] 0.051504556 -0.050655284 0.155160930 -0.027566334 -0.125709107 [16] 0.014007620 -0.028693052 0.122414751 -0.156480520 0.119060198 [21] -0.042023454 -0.034125952 0.014926479 -0.095296085 0.111360037 [26] -0.004089543 -0.154625215 -0.129041805 -0.120234625 -0.082375914 [31] 0.129729157 0.223801743 0.105497197 -0.026228133 -0.030228704 [36] -0.095364941 -0.052497973 0.173262071 -0.141283635 -0.057589395 [41] 0.084037044 -0.025916043 -0.008549195 -0.013746476 0.085149049 [46] -0.092839153 -0.050670603 -0.008972422 0.037548552 0.070617654 [51] -0.012597231 -0.095127827 0.089951361 -0.037893754 0.005647553 [56] -0.086967023 -0.061592752 -0.086317599 -0.021420223 -0.052820363 > 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/3vot11228666965.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/4xabg1228666965.tab") > > system("convert tmp/1gowd1228666965.ps tmp/1gowd1228666965.png") > system("convert tmp/2ua3j1228666965.ps tmp/2ua3j1228666965.png") > > > proc.time() user system elapsed 0.818 0.417 0.889