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.5,5.3,5.2,5.3,5.3,5,4.8,4.9,5.3,6,6.2,6.4,6.4,6.4,6.2,6.1,6,5.9,6.2,6.2,6.4,6.8,6.9,7,7,6.9,6.7,6.6,6.5,6.4,6.5,6.5,6.6,6.7,6.8,7.2,7.6,7.6,7.3,6.4,6.1,6.3,7.1,7.5,7.4,7.1,6.8,6.9,7.2,7.4,7.3,6.9,6.9,6.8,7.1,7.2,7.1,7,6.9,7,7.4,7.5,7.5,7.4,7.3,7,6.7,6.5,6.5,6.5,6.6,6.8,6.9,6.9,6.8,6.8,6.5,6.1,6,5.9,5.8,5.9,5.9,6.2,6.3,6.2,6,5.8,5.5,5.5,5.7,5.8) > par5 = '12' > par4 = '0' > par3 = '2' > par2 = '1.0' > par1 = '48' > #'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/11hhv1228852393.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/2qons1228852393.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.0000000000 0.0636465252 -0.1431009652 -0.4176887857 -0.3289568152 [6] 0.1218696933 0.2419423486 0.1452741773 -0.1177704693 -0.2068936609 [11] -0.0754068055 0.0445368758 0.3714838460 -0.0213731433 0.0233786892 [16] -0.1043722190 -0.1838868468 0.0079598461 0.0386535113 0.0716042217 [21] -0.0057178479 -0.0580834462 0.0154940779 -0.0406762537 0.0754626943 [26] -0.0386814557 0.0387652888 0.1140839621 -0.0716407644 0.0638442854 [31] -0.1703746695 -0.0331484706 -0.0387609897 0.1277423099 0.1066529094 [36] -0.0810064272 -0.0659186174 -0.0739816427 0.0226177425 0.1312761978 [41] 0.0331893124 0.0604651663 -0.0773457148 -0.0003503794 -0.1493175125 [46] 0.0192493713 -0.0037101524 0.0078953591 0.0578061521 > (mypacf <- c(rpacf$acf)) [1] 0.0636465252 -0.1477503644 -0.4083641989 -0.3874722732 -0.0397282941 [6] -0.0326856447 -0.1487521125 -0.2495512448 -0.2029564737 -0.1480540301 [11] -0.2553479191 0.0979537047 -0.2239461417 0.0226362409 0.1412714345 [16] -0.0118689447 -0.0141338854 0.0754298754 0.0854604228 -0.0087137116 [21] -0.0114852924 0.1071036771 -0.0282669665 -0.1043462866 -0.0810998800 [26] -0.1155473701 0.0616139162 -0.0821419380 0.0818333906 -0.1143840041 [31] 0.0539969363 -0.0541592027 0.1247977838 0.0358793864 -0.0217558087 [36] -0.0064733573 0.0434851912 -0.0631072543 -0.1252668717 -0.0228401692 [41] -0.0653986718 0.0701822223 0.1109441443 -0.0783140411 0.0006494173 [46] 0.0201380578 -0.0137135637 -0.0857930571 > 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/3md5e1228852393.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/43inc1228852393.tab") > > system("convert tmp/11hhv1228852393.ps tmp/11hhv1228852393.png") > system("convert tmp/2qons1228852393.ps tmp/2qons1228852393.png") > > > proc.time() user system elapsed 0.811 0.425 0.936