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(11514,31514,27071,29462,26105,22397,23843,21705,18089,20764,25316,17704,15548,28029,29383,36438,32034,22679,24319,18004,17537,20366,22782,19169,13807,29743,25591,29096,26482,22405,27044,17970,18730,19684,19785,18479,10698,31956,29506,34506,27165,26736,23691,18157,17328,18205,20995,17382,9367,31124,26551,30651,25859,25100,25778,20418,18688,20424,24776,19814,12738) > 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/14ei11229869111.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/2kbua1229869111.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.294876642 0.122123221 -0.087624810 -0.200876797 [6] -0.251977189 -0.468089932 -0.263643788 -0.198924972 -0.101873748 [11] 0.018895708 0.218417046 0.745501530 0.264341657 0.142762033 [16] -0.034967266 -0.124326124 -0.169164804 -0.371369968 -0.178291089 [21] -0.186163707 -0.112338722 0.002141823 0.154074633 0.547466488 [26] 0.172518780 0.088334335 -0.008426967 -0.054549730 -0.113413128 [31] -0.272560566 -0.117968438 -0.162055325 -0.104196974 0.003464677 [36] 0.096663969 0.396254242 0.121609109 0.052520485 -0.006228858 [41] -0.013585690 -0.090235585 -0.121664308 -0.050025433 -0.083343128 [46] -0.082996212 -0.056959216 0.001205978 0.199769694 0.023878948 [51] 0.016102148 -0.003998496 0.010884166 -0.017710572 -0.042115672 [56] -0.004970867 -0.008538366 -0.016441148 -0.042239612 -0.024400183 [61] 0.054450081 > (mypacf <- c(rpacf$acf)) [1] 0.294876642 0.038520424 -0.146549007 -0.159288622 -0.150899919 [6] -0.400260589 -0.110150829 -0.184936258 -0.249501841 -0.217495257 [11] -0.042520386 0.604819773 -0.196111027 -0.124495759 0.032192336 [16] 0.025653087 0.027639306 0.059374722 0.112405723 -0.085102376 [21] -0.023428820 0.185539903 0.004459778 -0.039567621 -0.070013218 [26] -0.064627824 0.041502447 0.082904543 -0.028476979 -0.042153072 [31] -0.052075087 -0.016753786 0.011814029 0.065604616 -0.094689056 [36] -0.097630932 0.071858072 0.016234503 -0.065549699 0.028582207 [41] -0.088752720 0.172658042 0.053759445 0.123232907 -0.030184908 [46] -0.203667670 -0.062651941 -0.025832948 -0.003732578 0.003314704 [51] -0.137570781 -0.099416189 0.047722828 -0.071375110 -0.128207492 [56] -0.091973211 0.019345287 -0.023880018 0.032083263 -0.018308961 > 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/3pr211229869111.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/4q6ev1229869111.tab") > > system("convert tmp/14ei11229869111.ps tmp/14ei11229869111.png") > system("convert tmp/2kbua1229869111.ps tmp/2kbua1229869111.png") > > > proc.time() user system elapsed 0.595 0.336 0.705