R version 2.10.1 (2009-12-14) 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(2851,2672,2755,2721,2946,3036,2282,2212,2922,4301,5764,7132,2541,2475,3031,3266,3776,3230,3028,1759,3595,4474,6838,8357,3113,3006,4047,3523,3937,3986,3260,1573,3528,5211,7614,9254,5375,3088,3718,4514,4520,4539,3663,1643,4739,5428,8314,10651,3633,4292,4154,4121,4647,4753,3965,1723,5048,6922,9858,11331,4016,3975,4510,4276,4968,4677,3523,1821,5222,6873,10803,13916,2639,2899,3370,3740,2927,3986,4217,1738,5221,6424,9842,13076,3934,3162,4286,4676,5010,4874,4633,1659,5951,6981,9851,12670) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '1' > par1 = '48' > #'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: > 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 (par6 == 'White Noise') par6 <- 'white' else par6 <- 'ma' > par7 <- as.numeric(par7) > 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/rcomp/tmp/1p09u1274007197.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > racf <- acf(x, par1, main='Autocorrelation', xlab='time lag', ylab='ACF', ci.type=par6, ci=par7, sub=paste('(lambda=',par2,', d=',par3,', D=',par4,', CI=', par7, ', CI type=',par6,')',sep='')) > dev.off() null device 1 > postscript(file="/var/www/rcomp/tmp/2p09u1274007197.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.481567002 0.050119994 -0.158616857 -0.253133003 [6] -0.024491697 0.052372973 -0.024634551 -0.251626505 -0.176523154 [11] 0.005742404 0.390302260 0.838362354 0.407339562 0.010173232 [16] -0.180952074 -0.257264213 -0.057280727 0.015513619 -0.051371978 [21] -0.248919421 -0.175524484 -0.019333639 0.300153195 0.682281251 [26] 0.319746613 -0.016019830 -0.185905261 -0.240729976 -0.067611743 [31] 0.007610076 -0.038429174 -0.203697410 -0.151340009 -0.026723673 [36] 0.228617821 0.502448858 0.213006479 -0.047349509 -0.176382382 [41] -0.219514832 -0.075435914 -0.014046274 -0.055748617 -0.179556428 [46] -0.135777788 -0.043523734 0.158678052 0.372463668 > (mypacf <- c(rpacf$acf)) [1] 0.481567002 -0.236672814 -0.102737144 -0.145322432 0.221306164 [6] -0.108075405 -0.096159018 -0.318922192 0.248291780 -0.020067567 [11] 0.542939166 0.610270934 -0.377396343 -0.059470200 0.026041536 [16] 0.017384586 -0.140858120 -0.056402428 0.015127349 0.055544674 [21] 0.015895203 -0.046010735 -0.083463217 -0.009879964 -0.038716520 [26] 0.074538996 -0.051420096 0.042718334 -0.013085248 0.095760543 [31] 0.022102033 0.052525940 -0.108932889 0.035673119 -0.052615975 [36] -0.214238218 0.010085747 0.067350492 0.049081434 -0.095613842 [41] 0.019696359 -0.045593779 -0.057397676 -0.032147479 -0.013765484 [46] -0.077487048 0.020666346 0.139341823 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/rcomp/tmp/3lsp31274007197.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/rcomp/tmp/4otnr1274007197.tab") > > try(system("convert tmp/1p09u1274007197.ps tmp/1p09u1274007197.png",intern=TRUE)) character(0) > try(system("convert tmp/2p09u1274007197.ps tmp/2p09u1274007197.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.610 0.490 1.008