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(0,9,1,4,6,21,24,23,22,21,20,16,18,18,24,16,15,24,18,15,4,3,6,5,12,12,12,14,12,17,12,20,21,15,22,19,19,26,25,19,20,30,31,35,33,26,25,17,14,8,12,7,4,10,8,16,14,20,9,10) > 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/11xil1229594727.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/2hm0j1229594727.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.181749871 0.089253761 -0.065482648 -0.052725749 [6] 0.073192464 -0.192067878 0.134133754 -0.181551717 0.091311858 [11] -0.026855507 -0.108562078 0.165374164 0.025802690 -0.060233908 [16] -0.163915365 -0.039394570 -0.035809455 -0.009029173 0.124023742 [21] -0.039549857 -0.047803429 -0.138780193 -0.027308525 0.098776984 [26] -0.060043427 0.155457135 -0.069071433 0.089321981 0.060973148 [31] -0.026539595 0.101297607 -0.025392038 0.061870845 -0.101771641 [36] -0.118340832 0.192961572 -0.008519444 0.115912782 -0.061300402 [41] 0.030016960 -0.054661584 -0.091749197 0.059893311 -0.155246972 [46] 0.055185491 -0.115040605 0.017697400 -0.017254723 0.043870544 [51] 0.062728844 -0.041228160 0.082032991 -0.140448655 0.055301080 [56] -0.056253152 0.084239537 -0.061206997 0.004258138 > (mypacf <- c(rpacf$acf)) [1] -0.1817498712 0.0581413286 -0.0411298561 -0.0788041199 0.0609431820 [6] -0.1714951812 0.0639953880 -0.1342614385 0.0208038335 -0.0068015776 [11] -0.1213850974 0.1004705788 0.1287744107 -0.1496775032 -0.1682971203 [16] -0.0896501689 -0.0818146803 -0.0024556287 0.1023815123 -0.0075641472 [21] -0.1200020757 -0.2435899734 -0.1104950275 0.1081345928 -0.0905411806 [26] 0.1034738361 0.0556497691 0.0097043205 0.0580980136 -0.0374061136 [31] -0.0259220729 0.0361162071 0.0198573879 0.0924194046 -0.0933291891 [36] 0.0944698739 0.0433048962 0.0144892190 -0.0222073385 0.0918745474 [41] -0.0253941093 -0.0524367400 0.0182984739 -0.0927235881 -0.0539050413 [46] -0.0658647802 0.0516237324 0.0282174442 0.0002891402 0.0030725185 [51] 0.0854985920 -0.0102289457 -0.0669862088 0.0854002686 -0.0828066303 [56] 0.0182196290 -0.0996282364 0.0396096464 > 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/3aus41229594727.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/4lz3t1229594727.tab") > > system("convert tmp/11xil1229594727.ps tmp/11xil1229594727.png") > system("convert tmp/2hm0j1229594727.ps tmp/2hm0j1229594727.png") > > > proc.time() user system elapsed 0.598 0.313 0.756