R version 2.9.0 (2009-04-17) Copyright (C) 2009 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(155,176,180,181,208,183,185,205,180,196,183,147,128,158,186,165,191,168,171,169,157,175,156,129,89,138,146,151,156,129,146,141,137,155,147,128,92,136,159,131,134,148,146,144,161,140,141,139,94,136,164,141,159,162,154,166,156,147,161,135,98,150,173,144,167,161,156,175,163,159,167,148,119,150,161,136,166,155,140,141) > par20 = '' > par19 = '' > par18 = '' > par17 = '' > par16 = '' > par15 = '' > par14 = '' > par13 = '' > par12 = '' > par11 = '' > par10 = '' > par9 = '' > par8 = '' > par7 = '' > par6 = '' > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '1' > par1 = '48' > ylab = '' > xlab = '' > main = '' > #'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/1n61i1244109141.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/2l50i1244109141.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.531678330 0.288505624 0.356098136 0.185817182 [6] 0.188374358 0.231972870 0.134074567 0.058633924 0.149419128 [11] 0.047315474 0.255495048 0.556553841 0.215251252 0.028694142 [16] 0.019879397 -0.071033082 -0.081257644 -0.079016773 -0.142097419 [21] -0.199689419 -0.149355114 -0.210492743 -0.047201378 0.176778388 [26] -0.039134845 -0.189500630 -0.166567382 -0.186031064 -0.206455711 [31] -0.181272179 -0.190216458 -0.247326469 -0.175254475 -0.147224197 [36] -0.075390185 0.108355575 0.002573744 -0.164703818 -0.122162668 [41] -0.110583267 -0.166867872 -0.120519011 -0.092904449 -0.177623374 [46] -0.096902696 -0.040926111 -0.007859051 0.158441731 > (mypacf <- c(rpacf$acf)) [1] 0.531678330 0.008118821 0.278325411 -0.164946408 0.189843362 [6] -0.002494412 0.012605426 -0.103846849 0.175911361 -0.195289858 [11] 0.553825332 0.176640901 -0.307467885 -0.303088434 -0.214998775 [16] 0.054676615 -0.048755988 -0.103185347 0.015436267 -0.010968548 [21] 0.045861921 -0.038515269 -0.125774488 0.024026381 -0.061191010 [26] -0.010827016 0.071966499 -0.019011477 -0.004193492 -0.011658412 [31] 0.047041958 -0.068121126 0.066415626 0.105782928 -0.137337922 [36] 0.014334491 -0.020758485 -0.061649630 -0.006148442 -0.106646064 [41] -0.021504691 0.053614843 0.038623591 -0.037837736 -0.063834341 [46] -0.028050562 0.095057252 -0.015032953 > 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/3tfoo1244109141.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/43qlv1244109141.tab") > > system("convert tmp/1n61i1244109141.ps tmp/1n61i1244109141.png") > system("convert tmp/2l50i1244109141.ps tmp/2l50i1244109141.png") > > > proc.time() user system elapsed 0.583 0.308 0.768