R version 2.7.0 (2008-04-22) 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(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) > 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/1wjwz1229530760.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/28xuh1229530760.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.886543707 0.708309768 0.564020298 0.498033260 [6] 0.505632646 0.525750804 0.491740367 0.428383695 0.377418201 [11] 0.362438651 0.356341492 0.332891775 0.242088028 0.152835020 [16] 0.089080848 0.048312925 0.042044007 0.040991651 0.004134925 [21] -0.045539924 -0.087313863 -0.108496362 -0.120207585 -0.132335936 [26] -0.163377396 -0.194065525 -0.213078954 -0.221615090 -0.224036610 [31] -0.227292386 -0.243420266 -0.268528683 -0.278433984 -0.273199963 [36] -0.259284756 -0.239382524 -0.230909621 -0.224478195 -0.208649103 [41] -0.204985449 -0.208741780 -0.231475017 -0.259949909 -0.286746471 [46] -0.277748476 -0.234698051 -0.186794210 -0.139543052 -0.107912141 [51] -0.096337762 -0.096447897 -0.125796306 -0.151616296 -0.161089745 [56] -0.145407875 -0.114513073 -0.074583752 -0.044479041 -0.029214300 [61] -0.015264741 > (mypacf <- c(rpacf$acf)) [1] 0.8865437071 -0.3627821135 0.1607938141 0.1972428259 0.1785406645 [6] -0.0158011237 -0.1571003820 0.0930156301 0.0872424731 0.0492739542 [11] -0.1228560436 -0.0490777598 -0.2545151731 0.1756520745 -0.1192422886 [16] -0.1283919533 0.0798294080 -0.0107154694 -0.0750067723 -0.0358622085 [21] 0.0052582394 0.0159484990 -0.0268945005 -0.0526015136 0.0169871938 [26] -0.0070683415 -0.0005999968 -0.0234672169 -0.0860913649 0.0344573553 [31] 0.0133469539 -0.1309084464 0.0677452748 -0.0103406680 0.0153694132 [36] 0.0144674283 -0.0477342132 0.0703324078 0.0479877207 -0.1602826388 [41] 0.0074994613 -0.1347483585 0.0112308296 -0.0693637953 0.0148794997 [46] 0.0787093216 0.0045906205 0.0679678217 0.0263858636 0.0036879146 [51] -0.0910561581 -0.0976605202 -0.0049028719 0.0500508409 0.0136934914 [56] -0.0575170505 0.0257771572 -0.0010291425 0.0509733762 -0.0175692721 > 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/3w19c1229530761.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/4nsin1229530761.tab") > > system("convert tmp/1wjwz1229530760.ps tmp/1wjwz1229530760.png") > system("convert tmp/28xuh1229530760.ps tmp/28xuh1229530760.png") > > > proc.time() user system elapsed 1.542 0.544 1.645