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(357,363,364,363,358,357,357,380,378,376,380,379,384,392,394,392,396,392,396,419,421,420,418,410,418,426,428,430,424,423,427,441,449,452,462,455,461,461,463,462,456,455,456,472,472,471,465,459,465,468,467,463,460,462,461,476,476,471,453,443,442,444,438,427,424,416,406,431,434,418,412,404,409,412,406,398,397,385,390,413,413,401,397,397) > 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/1aooa1229603488.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/2791n1229603488.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.144119016 -0.210048635 -0.148615644 -0.151312760 [6] 0.191561650 0.374694479 0.186080864 -0.134561407 -0.169017306 [11] -0.203499838 0.211465458 0.634140748 0.059377159 -0.143094028 [16] -0.144366326 -0.160550383 0.145209970 0.265473279 0.166554372 [21] -0.175462383 -0.207148543 -0.094062586 0.140592268 0.378243234 [26] 0.044795360 -0.160398960 -0.185207380 -0.163309747 0.082146645 [31] 0.130816200 0.068827144 -0.217763763 -0.139608030 -0.079169304 [36] 0.052508081 0.297602720 0.015377259 -0.172725907 -0.250680910 [41] -0.105365668 0.047155777 0.121709518 0.015790806 -0.210067807 [46] -0.108790969 -0.062584883 -0.014714291 0.242169493 0.011883293 [51] -0.210249044 -0.178513069 -0.091535451 0.012812957 0.162058653 [56] 0.003000016 -0.169254829 -0.078382267 -0.095687091 -0.023330499 [61] 0.238082962 > (mypacf <- c(rpacf$acf)) [1] 0.1441190164 -0.2357147908 -0.0835156125 -0.1765327495 0.2118097038 [6] 0.2687608447 0.1915964907 -0.0486918210 0.0122236785 -0.2044953787 [11] 0.1953395112 0.4840902855 -0.0603836421 0.0431254075 0.0085899311 [16] -0.0410208624 -0.0609579420 -0.1267135308 0.0559776950 -0.1548411206 [21] -0.0254790432 0.0945824144 -0.1006625130 -0.0009491469 0.0223930325 [26] -0.0924470245 -0.0444753419 -0.0976130372 -0.0186134711 -0.1849127649 [31] -0.0891721171 -0.0560937963 0.0712619622 -0.0791333763 0.0465621815 [36] 0.1262699953 0.0398353758 0.0025530613 -0.1321824643 0.0619609333 [41] -0.0839995380 0.0889900234 -0.0194713986 -0.0234747813 0.0566617394 [46] 0.0742654464 -0.1471909049 0.0277800432 -0.0173945565 -0.0527614675 [51] 0.0271357001 -0.0837855013 0.0080507179 0.1001708139 -0.0744961582 [56] 0.0802869823 -0.0751955996 -0.0547733547 -0.0661757540 -0.0656815319 > 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/3u74g1229603488.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/40x5o1229603488.tab") > > system("convert tmp/1aooa1229603488.ps tmp/1aooa1229603488.png") > system("convert tmp/2791n1229603488.ps tmp/2791n1229603488.png") > > > proc.time() user system elapsed 0.668 0.367 1.919