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(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) > par5 = '12' > par4 = '1' > 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/12x401228471092.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/2kqf01228471092.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.453966627 -0.042753463 -0.402189630 -0.542764799 [6] -0.233363647 0.042352920 0.171372827 0.228050796 0.029045601 [11] -0.035339655 0.024416695 0.011831107 0.051814783 -0.017010444 [16] -0.095603609 -0.106176410 -0.129417929 0.004693144 0.066166283 [21] 0.137052161 0.107772280 -0.011787022 -0.050183645 -0.082245908 [26] -0.003782478 0.104813559 -0.035761609 -0.098430076 -0.153816990 [31] -0.092047853 0.176860757 0.233065130 0.165601493 0.057822915 [36] -0.166519717 -0.268141535 -0.152737542 -0.011226515 0.159825122 [41] 0.177549740 0.122932422 0.056415979 -0.071016873 -0.133685340 [46] -0.095240854 -0.052178798 > (mypacf <- c(rpacf$acf)) [1] 0.453966627 -0.313433276 -0.327424124 -0.313917646 0.089282853 [6] -0.096343134 -0.137795970 0.009479748 -0.153286544 0.050319628 [11] 0.115465005 -0.013278671 0.010265145 -0.014992983 0.023055542 [16] -0.059469815 -0.095657479 0.047880954 -0.108220564 0.094084850 [21] -0.069372328 -0.043133646 0.031039127 -0.018704732 0.129566030 [26] 0.054098735 -0.190976570 -0.024987934 -0.079622809 0.060770320 [31] 0.109750815 -0.035873192 -0.021250847 0.063473213 0.070533464 [36] -0.184670196 0.069020401 0.030645831 -0.013929000 0.039530143 [41] 0.072834590 0.026197970 -0.028378387 -0.033096168 0.050940018 [46] -0.091916239 > 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/3yili1228471092.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/4khm51228471092.tab") > > system("convert tmp/12x401228471092.ps tmp/12x401228471092.png") > system("convert tmp/2kqf01228471092.ps tmp/2kqf01228471092.png") > > > proc.time() user system elapsed 0.579 0.310 0.692