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 = '0' > 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/rcomp/tmp/1km801228666765.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/2f43b1228666765.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.374375133 -0.111673474 -0.383234780 -0.380265431 [6] -0.067753769 0.215605371 0.110134702 -0.095605916 -0.151279047 [11] -0.119985431 0.138843053 0.487941079 0.142378790 -0.004473939 [16] -0.144056432 -0.156118373 -0.048103827 0.082958695 -0.031101282 [21] -0.136571951 -0.128561495 -0.062082391 0.132162675 0.326489544 [26] 0.057320973 -0.033864858 -0.106634802 -0.085085961 -0.026868954 [31] 0.003852042 -0.054132022 -0.099313927 -0.025400980 0.012999266 [36] 0.069733595 0.164209754 -0.069527919 -0.057642050 -0.018996395 [41] 0.080602673 0.115035477 0.033021800 -0.140672518 -0.295368103 [46] -0.173058495 -0.034725736 0.190491967 0.327004610 0.091365018 [51] -0.085386684 -0.145272667 -0.082750780 -0.010238709 0.049062188 [56] -0.019413103 -0.094166769 -0.045285521 -0.078411718 0.011524378 [61] 0.119794558 > (mypacf <- c(rpacf$acf)) [1] 0.374375133 -0.292879209 -0.279276429 -0.192024724 0.060297347 [6] 0.077219433 -0.211114668 -0.170819303 0.006675166 -0.045534037 [11] 0.116906846 0.385910071 -0.275140970 0.268029063 0.125660014 [16] 0.123241400 -0.047453485 0.036059674 -0.040776633 -0.086848594 [21] -0.106313214 0.006354169 -0.072986047 -0.007126853 -0.100441619 [26] -0.030788683 0.030878237 -0.010429318 -0.037853928 -0.129642481 [31] 0.104535935 -0.034272030 0.091533397 -0.040985257 -0.024383556 [36] 0.067146157 -0.114486521 0.026585118 0.031413641 0.091710058 [41] 0.094028716 -0.021074404 -0.051750288 -0.154155638 -0.070469729 [46] -0.094058121 0.015041764 0.034661597 0.034454859 -0.143513019 [51] 0.078636864 -0.091797608 -0.047677360 -0.060253674 0.014824275 [56] 0.122695782 -0.009806046 -0.030218265 -0.074847241 0.005356086 > 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/337iu1228666765.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/4brg81228666765.tab") > > system("convert tmp/1km801228666765.ps tmp/1km801228666765.png") > system("convert tmp/2f43b1228666765.ps tmp/2f43b1228666765.png") > > > proc.time() user system elapsed 0.591 0.334 0.720