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(137,136,133,126,120,114,116,153,162,161,149,139,135,130,127,122,117,112,113,149,157,157,147,137,132,125,123,117,114,111,112,144,150,149,134,123,116,117,111,105,102,95,93,124,130,124,115,106,105,105,101,95,93,84,87,116,120,117,109,105) > 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/1fpqu1228674410.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/2tmgy1228674410.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.0000000000 -0.0918698356 0.1549177620 -0.1256597693 0.0186482125 [6] -0.1677709362 -0.0468070848 0.1393862987 -0.0469770028 0.1079419474 [11] -0.0388256878 0.4204605137 -0.1987186038 0.0191401432 -0.0985869470 [16] -0.0333027560 -0.2668010960 0.0009850496 -0.0228070467 -0.1019995675 [21] 0.0711255707 -0.0024263827 0.1781822805 -0.1495302894 -0.0788847670 [26] 0.0081239855 -0.0291272865 -0.0974296028 -0.0266723861 0.0201263810 [31] 0.0068335587 0.0882575911 0.0673695493 -0.0248353696 -0.0769419973 [36] -0.0559446376 0.0178283281 0.0230209296 0.0048694007 -0.0186993068 [41] -0.0029515840 -0.0661159578 0.0522230751 0.0390419472 -0.0056370027 [46] -0.0106085919 -0.0525510289 > (mypacf <- c(rpacf$acf)) [1] -0.091869836 0.147724500 -0.103058361 -0.021238299 -0.140129282 [6] -0.084453874 0.182907875 -0.043385054 0.047665635 -0.009623656 [11] 0.405078157 -0.111365579 -0.135172521 0.013791917 -0.029658829 [16] -0.227956717 -0.051249313 -0.142821254 -0.132113167 0.026451773 [21] -0.020094226 -0.018171539 0.050202779 -0.135441062 0.135525061 [26] 0.094705199 0.043815499 -0.133360801 0.015802495 0.152345004 [31] 0.009268466 -0.068446149 -0.192123806 -0.078198895 0.073527051 [36] -0.097311686 -0.060038109 0.027295804 -0.025462771 -0.062753172 [41] -0.045226691 0.018089215 0.049667810 0.053781051 0.016767625 [46] -0.018792780 > 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/3ktca1228674411.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/4hucl1228674411.tab") > > system("convert tmp/1fpqu1228674410.ps tmp/1fpqu1228674410.png") > system("convert tmp/2tmgy1228674410.ps tmp/2tmgy1228674410.png") > > > proc.time() user system elapsed 1.542 0.568 1.652