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(5.7,5.7,5.6,5.8,5.6,5.6,5.6,5.5,5.4,5.4,5.5,5.4,5.4,5.2,5.4,5.2,5.1,5.1,5.0,5.0,4.9,5.1,5.0,5.0,4.8,4.7,4.7,4.7,4.7,4.7,4.6,4.7,4.7,4.5,4.4,4.5,4.4,4.6,4.5,4.4,4.5,4.5,4.6,4.7,4.7,4.7,4.8,4.7,5.0,4.9,4.8,5.1,5.0,5.5,5.5,5.7,6.1,6.1,6.5,6.7) > 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/1tu2g1229370893.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/2zcfz1229370893.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.866766830 0.764670849 0.676048668 0.555679164 [6] 0.485401689 0.399281058 0.314380697 0.269810214 0.209986374 [11] 0.174598413 0.125157025 0.047039323 0.004339919 -0.045060793 [16] -0.100573018 -0.141421681 -0.196293264 -0.235901321 -0.266337025 [21] -0.293111922 -0.299732049 -0.328347519 -0.358793392 -0.367254090 [26] -0.368993143 -0.356678768 -0.348035367 -0.359546738 -0.366787168 [31] -0.355103265 -0.348300437 -0.333576031 -0.324952969 -0.290683927 [36] -0.257624984 -0.227637051 -0.204370765 -0.193327503 -0.174962629 [41] -0.138263219 -0.098533474 -0.055753058 -0.022755129 0.013283302 [46] 0.045040625 0.057863445 0.091441002 0.117076643 0.128648688 [51] 0.144491673 0.169507011 0.192661440 0.213375331 0.202301223 [56] 0.198548728 0.185013745 0.137250226 0.110251613 0.058796781 > (mypacf <- c(rpacf$acf)) [1] 0.8667668304 0.0538210286 0.0091903883 -0.1684974535 0.1076979834 [6] -0.0918828742 -0.0337834787 0.0632065310 -0.0412948246 0.0414301561 [11] -0.1092884962 -0.1247932116 0.0228699518 -0.0285064686 -0.0637469340 [16] -0.0524699210 -0.0576262952 -0.0299926443 -0.0449308671 -0.0058596322 [21] 0.0053636550 -0.1002989796 -0.0812997630 -0.0140830733 0.0376044964 [26] 0.0083897701 -0.0492547992 -0.1055576133 -0.0789755426 0.0339317016 [31] -0.0499156785 -0.0122903653 -0.0406568745 0.0755925334 -0.0639195301 [36] -0.0288654159 -0.0731107122 -0.0395846502 0.0001647428 0.0327446282 [41] 0.0242471293 0.0073196575 -0.0286681513 0.0054177172 -0.0395517447 [46] -0.0730624853 0.0644148526 0.0033429776 -0.0127589526 -0.0346859876 [51] 0.0581773904 -0.0017295118 -0.0075030969 -0.1154913293 -0.0024531276 [56] -0.0423655759 -0.1594673388 -0.0089033909 -0.0843298253 > 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/33j021229370893.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/4zb9h1229370893.tab") > > system("convert tmp/1tu2g1229370893.ps tmp/1tu2g1229370893.png") > system("convert tmp/2zcfz1229370893.ps tmp/2zcfz1229370893.png") > > > proc.time() user system elapsed 0.814 0.414 0.924