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(8.2,8.21,8.22,8.2,8.18,8.2,8.19,8.24,8.31,8.27,8.36,8.32,8.29,8.27,8.27,8.43,8.46,8.48,8.46,8.46,8.43,8.4,8.38,8.3,8.39,8.53,8.52,8.54,8.62,8.52,8.49,8.44,8.31,8.26,8.21,8.03,7.89,7.83,7.85,7.84,7.88,8.01,8.08,8.11,8.11,8.07,8.06,7.95,7.95,8.07,8.17,8.21,8.2,8.19,8.18,8.16,8.17,8.17,8.19,8.01,8.04,8.13,8.14,8.17,8.25,8.27,8.27,8.26,8.24,8.21,8.25,8.06,8.16,8.32,8.43,8.39,8.41) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '1' > par1 = '48' > #'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: > 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 (par6 == 'White Noise') par6 <- 'white' else par6 <- 'ma' > par7 <- as.numeric(par7) > 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/1veca1264428171.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > racf <- acf(x, par1, main='Autocorrelation', xlab='time lag', ylab='ACF', ci.type=par6, ci=par7, sub=paste('(lambda=',par2,', d=',par3,', D=',par4,', CI=', par7, ', CI type=',par6,')',sep='')) > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/25q2d1264428171.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.912578500 0.787303851 0.656207595 0.524049227 [6] 0.416221551 0.345233042 0.282601905 0.242000396 0.204704738 [11] 0.154913582 0.106845925 0.064851341 -0.009756136 -0.077009407 [16] -0.125987214 -0.167195489 -0.205831766 -0.232143976 -0.260262424 [21] -0.265898062 -0.255423560 -0.225800760 -0.191722389 -0.190301796 [26] -0.230630746 -0.274308269 -0.313829820 -0.335292223 -0.325322278 [31] -0.289384671 -0.249977894 -0.208329002 -0.175439288 -0.161129502 [36] -0.154119843 -0.152605694 -0.168832707 -0.164463726 -0.139852428 [41] -0.117078195 -0.092538822 -0.066456575 -0.052451254 -0.028439151 [46] 0.011071457 0.035481040 0.053068014 0.069392784 > (mypacf <- c(rpacf$acf)) [1] 0.9125785001 -0.2721024954 -0.0610598829 -0.0822932224 0.0727006611 [6] 0.1016263237 -0.0880567405 0.0738666278 -0.0730220635 -0.0847338058 [11] 0.0110862935 -0.0022479156 -0.2407525392 0.0449423166 0.0244640639 [16] -0.0252003885 -0.1064834405 -0.0246165580 -0.0329048608 0.0837181243 [21] 0.0180768392 0.1100114077 -0.0589036438 -0.2843254641 -0.1298724871 [26] 0.0516350153 0.0116696559 0.0291303501 0.0678239989 0.0107776870 [31] -0.0867554564 -0.0651074296 0.0316390366 -0.0964078914 -0.0241730518 [36] 0.0759924104 -0.0687026392 0.0121465130 0.0183897106 -0.0582268951 [41] -0.0314195623 0.0069046144 0.0170042622 0.0627425262 0.0003667577 [46] -0.1590145888 0.0121553678 0.0727631625 > 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/38ih11264428171.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/4011s1264428171.tab") > > try(system("convert tmp/1veca1264428171.ps tmp/1veca1264428171.png",intern=TRUE)) character(0) > try(system("convert tmp/25q2d1264428171.ps tmp/25q2d1264428171.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.592 0.339 1.532