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.8,7.6,7.5,7.6,7.5,7.3,7.6,7.5,7.6,7.9,7.9,8.1,8.2,8.0,7.5,6.8,6.5,6.6,7.6,8.0,8.0,7.7,7.5,7.6,7.7,7.9,7.8,7.5,7.5,7.1,7.5,7.5,7.6,7.7,7.7,7.9,8.1,8.2,8.2,8.1,7.9,7.3,6.9,6.6,6.7,6.9,7.0,7.1,7.2,7.1,6.9,7.0,6.8,6.4,6.7,6.7,6.4,6.3,6.2,6.5,6.8,6.8,6.5,6.3,5.9,5.9,6.4,6.4) > 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/rcomp/tmp/1t5y31228766889.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/rcomp/tmp/2vwxb1228766889.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.882219908 0.699957564 0.513642962 0.385766472 [6] 0.357912242 0.368092152 0.370293112 0.358299758 0.346637432 [11] 0.333034590 0.335178476 0.337602024 0.292402992 0.237832402 [16] 0.151597133 0.074784789 0.025693307 -0.004381104 -0.024798587 [21] -0.047207955 -0.067123186 -0.094526532 -0.118328506 -0.119454963 [26] -0.123686248 -0.111280449 -0.110238093 -0.120171074 -0.143630604 [31] -0.168922210 -0.196428290 -0.205527990 -0.189623553 -0.165015324 [36] -0.126435370 -0.101992656 -0.119630634 -0.144419988 -0.176309354 [41] -0.178035088 -0.177877379 -0.183432782 -0.208673022 -0.238519137 [46] -0.235764559 -0.208724976 -0.153850383 -0.096533021 -0.087117902 [51] -0.109475903 -0.160507902 -0.213868522 -0.242944138 -0.229824914 [56] -0.207162910 -0.176293659 -0.139328900 -0.115063115 -0.085198368 [61] -0.070081552 > (mypacf <- c(rpacf$acf)) [1] 0.882219908 -0.353444440 -0.053174743 0.165306894 0.280786055 [6] -0.063658134 -0.089151657 0.091918706 0.181418410 -0.041450646 [11] 0.020259599 0.027849831 -0.184567870 0.054741761 -0.153206306 [16] 0.007994768 -0.066156402 -0.035762784 -0.079490232 -0.042429539 [21] 0.016936356 -0.068127812 -0.070464096 0.125750951 -0.036415969 [26] 0.039543549 -0.013900543 0.009953476 -0.037274992 0.006211765 [31] -0.050435352 0.068757611 0.031091197 0.018341986 0.037694780 [36] -0.070328086 -0.122227195 0.001542481 0.004185503 0.066486602 [41] -0.207640714 -0.063672971 -0.022219148 0.002397861 0.069837865 [46] -0.058725486 0.038909124 0.082516580 -0.139722121 -0.009879343 [51] -0.014758056 -0.093978847 0.036529562 0.035095212 0.017360900 [56] 0.002795950 0.028295294 0.052065554 -0.023475869 -0.120150824 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/html/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/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/rcomp/tmp/32tpa1228766890.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/rcomp/tmp/433561228766890.tab") > > system("convert tmp/1t5y31228766889.ps tmp/1t5y31228766889.png") > system("convert tmp/2vwxb1228766889.ps tmp/2vwxb1228766889.png") > > > proc.time() user system elapsed 0.603 0.299 1.107