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(17704,15548,28029,29383,36438,32034,22679,24319,18004,17537,20366,22782,19169,13807,29743,25591,29096,26482,22405,27044,17970,18730,19684,19785,18479,10698,31956,29506,34506,27165,26736,23691,18157,17328,18205,20995,17382,9367,31124,26551,30651,25859,25100,25778,20418,18688,20424,24776,19814,12738,31566,30111,30019,31934,25826,26835,20205,17789,20520,22518,15572) > par5 = '12' > par4 = '0' > par3 = '0' > 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/1m1801229699463.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/2dpgl1229699463.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.358794715 0.150112195 -0.073328426 -0.250143402 [6] -0.311067418 -0.505276106 -0.272216858 -0.178058899 -0.089393977 [11] 0.067825308 0.257823983 0.698356191 0.228982262 0.098314067 [16] -0.036394454 -0.164864603 -0.240999947 -0.428460547 -0.232999735 [21] -0.194125241 -0.075253709 0.068800137 0.281872881 0.577100919 [26] 0.251445035 0.099281016 -0.025206293 -0.125656044 -0.194994302 [31] -0.310021632 -0.148521382 -0.159009564 -0.061908603 0.023647891 [36] 0.150308862 0.327815807 0.137155738 0.030743174 0.004757748 [41] -0.063099078 -0.114101666 -0.136129727 -0.083628842 -0.083245818 [46] -0.033192799 0.020086066 0.117311830 0.199099939 0.114567615 [51] 0.041292011 0.016891486 -0.052753738 -0.078390540 -0.058092749 [56] -0.052873462 -0.027577678 -0.000355311 -0.007965285 0.028002803 [61] 0.018918157 > (mypacf <- c(rpacf$acf)) [1] 0.358794715 0.024537327 -0.154661447 -0.212395819 -0.167145055 [6] -0.401590031 -0.054028500 -0.159292238 -0.237724030 -0.166452192 [11] 0.021008776 0.536267452 -0.353997093 -0.147315440 0.036815829 [16] 0.080297663 -0.102920208 -0.134617061 -0.129742333 -0.206059093 [21] 0.072483036 0.006529620 -0.021505197 -0.114737782 0.103332016 [26] -0.096612853 -0.085586742 0.014629641 0.041254553 0.067874587 [31] 0.034159802 -0.016394390 -0.056106268 0.044833015 -0.147409227 [36] -0.193249431 -0.075007762 -0.075684263 -0.006087408 -0.136164482 [41] -0.112430640 0.062013112 -0.036684277 0.013116688 -0.105290714 [46] -0.070792909 0.010035426 -0.003322977 -0.006873175 0.002048727 [51] -0.023980486 -0.073202329 0.029486690 -0.071835365 -0.013849237 [56] 0.034390572 0.086072783 -0.113622727 -0.044425612 0.009039166 > 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/31n1w1229699463.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/4qs791229699463.tab") > > system("convert tmp/1m1801229699463.ps tmp/1m1801229699463.png") > system("convert tmp/2dpgl1229699463.ps tmp/2dpgl1229699463.png") > > > proc.time() user system elapsed 0.603 0.331 0.711