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(3851.3,3851.8,3854.1,3858.4,3861.6,3856.3,3855.8,3860.4,3855.1,3839.5,3833,3833.6,3826.8,3818.2,3811.4,3806.8,3810.3,3818.2,3858.9,3867.8,3872.3,3873.3,3876.7,3882.6,3883.5,3882.2,3888.1,3893.7,3901.9,3914.3,3930.3,3948.3,3971.5,3990.1,3993,3998,4015.8,4041.2,4060.7,4076.7,4103,4125.3,4139.7,4146.7,4158,4155.1,4144.8,4148.2,4142.5,4142.1,4145.4,4146.3,4143.5,4149.2,4158.9,4166.1,4179.1,4194.4,4211.7,4226.3,4235.8,4243.6,4258.7,4278.2,4298,4315.1,4334.3,4356,4374,4395.5,4417.8,4432.8,4446.3) > par20 = '' > par19 = '' > par18 = '' > par17 = '' > par16 = '' > par15 = '' > par14 = '' > par13 = '' > par12 = '' > par11 = '' > par10 = '' > par9 = '' > par8 = '' > par7 = '' > par6 = '' > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '1' > par1 = '48' > ylab = '' > xlab = '' > main = '' > #'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/1euuz1242325786.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/2xi0b1242325786.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.958745630 0.915643036 0.871703460 0.828503821 [6] 0.786073833 0.743616243 0.702394608 0.662486873 0.623050244 [11] 0.583950045 0.545788306 0.508367450 0.470082208 0.431197802 [16] 0.392604904 0.355114677 0.319364791 0.285396542 0.254614831 [21] 0.224912295 0.195327784 0.164177781 0.132063184 0.099622391 [26] 0.065899895 0.029713896 -0.007107765 -0.046489229 -0.086916307 [31] -0.126081482 -0.164361188 -0.200395333 -0.232519134 -0.260482808 [36] -0.287013386 -0.311361004 -0.331698657 -0.348627411 -0.364559941 [41] -0.380039996 -0.391729043 -0.398904142 -0.402702402 -0.403881936 [46] -0.402631032 -0.400654703 -0.398957683 -0.396408799 > (mypacf <- c(rpacf$acf)) [1] 0.958745630 -0.043933772 -0.032387432 -0.013865381 -0.014370798 [6] -0.024684534 -0.009078004 -0.008385096 -0.019134655 -0.020506339 [11] -0.012847730 -0.015852655 -0.036034219 -0.032639869 -0.022335251 [16] -0.013838809 -0.006611181 -0.005713134 0.011896656 -0.013938467 [21] -0.024694303 -0.044437848 -0.037543810 -0.031399247 -0.044273665 [26] -0.060539186 -0.040275373 -0.068260798 -0.053661493 -0.027412630 [31] -0.035248674 -0.020175118 0.002903739 0.009031117 -0.023156022 [36] -0.011768296 0.013461363 0.006329623 -0.023101914 -0.027885560 [41] 0.014364362 0.022949079 0.010818340 0.004630596 0.004986677 [46] -0.016248895 -0.023985970 -0.005047269 > 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/3ygsl1242325786.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/4z59w1242325786.tab") > > system("convert tmp/1euuz1242325786.ps tmp/1euuz1242325786.png") > system("convert tmp/2xi0b1242325786.ps tmp/2xi0b1242325786.png") > > > proc.time() user system elapsed 0.589 0.327 0.969