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(90.8,96.4,90,92.1,97.2,95.1,88.5,91,90.5,75,66.3,66,68.4,70.6,83.9,90.1,90.6,87.1,90.8,94.1,99.8,96.8,87,96.3,107.1,115.2,106.1,89.5,91.3,97.6,100.7,104.6,94.7,101.8,102.5,105.3,110.3,109.8,117.3,118.8,131.3,125.9,133.1,147,145.8,164.4,149.8,137.7,151.7,156.8,180,180.4,170.4,191.6,199.5,218.2,217.5,205,194,199.3) > 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/freestat/rcomp/tmp/1ocz71229707342.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/2l4rs1229707342.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.93894829 0.87947292 0.81405584 0.74408378 0.68118192 [7] 0.61095225 0.54170014 0.49474446 0.44490649 0.39474022 0.34650724 [13] 0.29539851 0.25488723 0.20906048 0.15534776 0.11309697 0.07114519 [19] 0.03429719 0.01010230 -0.02234448 -0.05352102 -0.08261194 -0.10736825 [25] -0.12104765 -0.13003148 -0.14570768 -0.16506409 -0.17828502 -0.19259397 [31] -0.20228254 -0.21933831 -0.23428806 -0.24820195 -0.26568371 -0.28735061 [37] -0.30649376 -0.31971975 -0.32770118 -0.34059213 -0.35586581 -0.36247673 [43] -0.36991220 -0.37239490 -0.36923754 -0.36141199 -0.34022124 -0.31047515 [49] -0.28368299 -0.25163037 -0.22039284 -0.18954487 -0.17073923 -0.15737347 [55] -0.13438409 -0.11457003 -0.09186842 -0.06539797 -0.03987823 -0.02294354 > (mypacf <- c(rpacf$acf)) [1] 0.9389482908 -0.0181706398 -0.0816938406 -0.0761654135 0.0212810590 [6] -0.0946861838 -0.0411545147 0.1491801062 -0.0465991204 -0.0668736244 [11] -0.0257420003 -0.0391947808 0.0263241460 -0.0785894270 -0.0813258478 [16] 0.0474764783 -0.0235942472 -0.0142620093 0.0646391737 -0.0673203146 [21] -0.0719152227 -0.0381533704 0.0472069228 0.0483141682 0.0231089432 [26] -0.0710121412 -0.1031911173 0.0360393002 -0.0343074202 0.0076662249 [31] -0.0507371077 -0.0203686191 -0.0545842028 -0.0568898271 -0.0582096986 [36] -0.0009423838 0.0250358675 -0.0345924994 -0.0815751015 -0.0286638582 [41] 0.0431991126 -0.0539700850 -0.0047335457 0.0198803483 0.0308744778 [46] 0.0792722305 0.0668958468 -0.0111921506 -0.0055767870 -0.0199573427 [51] -0.0101205275 -0.0918420491 -0.0073028666 0.1042985061 -0.0320115092 [56] 0.0053868897 0.0220284702 0.0068697044 -0.1096914561 > 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/3bxgw1229707342.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/4evps1229707342.tab") > > system("convert tmp/1ocz71229707342.ps tmp/1ocz71229707342.png") > system("convert tmp/2l4rs1229707342.ps tmp/2l4rs1229707342.png") > > > proc.time() user system elapsed 0.810 0.409 0.913