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(121148,114624,109822,112081,113534,112110,109826,107423,105540,108573,128591,139145,129700,132828,126868,128390,126830,124105,122323,119296,116822,119224,139357,144322,133676,128283,121640,122877,117284,116463,112685,113235,111692,113152,129889,131153,123770,112516,105940,104320,103582,99064,94989,92241,89752,90610,109456,110213,97694,91844,87572,89812,89050,85990,85070,83277,79586,84215,99708,100698,90861,86700) > 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/13cnj1229366129.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/2i6kl1229366129.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.116475367 0.205067439 -0.075308173 0.115583949 [6] 0.089523666 -0.074652831 0.065770361 -0.091042759 0.206945965 [11] -0.052470748 0.143207102 -0.278245526 0.013854204 0.078507569 [16] -0.136949025 -0.025348625 -0.102220278 0.169575656 0.021488752 [21] 0.038433141 -0.045092814 -0.085735569 0.092104382 -0.197245396 [26] 0.009538173 -0.213846047 0.024888103 -0.086957678 -0.077217540 [31] -0.099811886 -0.022158128 -0.081298600 0.056793960 -0.075600134 [36] -0.145506363 0.055425931 -0.005114111 0.037194652 0.001596983 [41] 0.015544073 0.047988299 0.040972424 -0.028066508 0.064401582 [46] -0.074526531 0.003137889 0.054709438 0.038636947 > (mypacf <- c(rpacf$acf)) [1] -0.116475367 0.194134658 -0.035235921 0.069397066 0.134331518 [6] -0.099446337 0.021538024 -0.050648799 0.158228398 0.014463879 [11] 0.083801084 -0.265151452 -0.093626555 0.161521232 -0.142789189 [16] -0.083154420 0.058530175 0.101608225 0.081983430 -0.014974323 [21] 0.012477109 -0.119712483 0.092194741 -0.234704754 -0.105667355 [26] 0.002919753 -0.113037089 -0.145701419 -0.068085066 -0.040000374 [31] 0.112462969 -0.141417385 0.199309656 -0.061558617 -0.064217073 [36] 0.001425799 -0.028642072 0.009138636 0.025715151 -0.045472728 [41] -0.034844498 0.004078321 0.066463990 -0.042518683 0.052577766 [46] -0.051371982 0.033457479 0.099693407 > 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/3ygh41229366129.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/4gzpe1229366129.tab") > > system("convert tmp/13cnj1229366129.ps tmp/13cnj1229366129.png") > system("convert tmp/2i6kl1229366129.ps tmp/2i6kl1229366129.png") > > > proc.time() user system elapsed 0.599 0.312 0.689