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(12460,12870,14122,15366,15366,15046,10356,10194,11027,11449,12107,12862,12587,13951,15210,17511,17247,16900,12237,12188,12801,13276,14171,14629,16242,17239,18516,19862,19542,18515,13182,13148,13853,14341,14895,15317,15649,16373,17543,18911,19401,18295,12665,12246,12969,13563,15714,16094,15823,15460,16827,18279,18789,18041,12129,11708,12387,12982,13664,14073,14222,14715,15697,16908,17412,16232,10281,10258,11013,11779,12333,12684,12654,13239,14729,16146,16324,13797,9399,9626,10290,10931,11382,11704,11716,12470,13662,15097,15821,13083,9081,9479,10295,10999,11643,12055,12431,12940,14168,16031,16445,14245,9820,10389,11298,12156,12759,13414,13683,14070,15176,16694,17694,14294,9255,9868,10878,11685,12496,12488) > par5 = '12' > par4 = '0' > 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/1nqrd1229611366.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/28yr91229611366.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.311451690 -0.145977067 -0.336562531 -0.269401851 [6] -0.070579405 0.023518940 -0.059145818 -0.237084835 -0.283386315 [11] -0.121365642 0.310263436 0.862154390 0.259277526 -0.124625249 [16] -0.306918872 -0.247701698 -0.067214405 0.008068779 -0.053066106 [21] -0.213205602 -0.238472106 -0.101657414 0.298138925 0.761313416 [26] 0.206374213 -0.119050481 -0.276804675 -0.221268280 -0.057475986 [31] 0.021185508 -0.045491636 -0.185368705 -0.213900201 -0.103799070 [36] 0.284749259 0.664392987 0.163880528 -0.099132914 -0.250268821 [41] -0.198548168 -0.052272361 0.023450903 -0.040696977 -0.162981444 [46] -0.187158230 -0.081014959 0.272607711 0.563730691 0.106473226 [51] -0.092219794 -0.210489400 -0.146461835 -0.039293096 0.016517213 [56] -0.051479935 -0.138419335 -0.149135471 -0.057500692 0.250558673 [61] 0.451079326 > (mypacf <- c(rpacf$acf)) [1] 0.311451690 -0.269080622 -0.232873081 -0.139835961 -0.053197531 [6] -0.104214555 -0.209317361 -0.341043520 -0.397806783 -0.464481239 [11] -0.251730914 0.663414122 -0.262323494 0.110198768 0.121197241 [16] 0.059535081 0.044261208 -0.008890651 0.062365759 -0.016173138 [21] 0.008106283 -0.021724910 -0.035715964 0.079635868 -0.115549777 [26] -0.036769055 0.013820033 -0.042067877 -0.011411195 0.074847510 [31] -0.014855447 0.065179919 -0.025714083 -0.026706379 0.034047252 [36] -0.057736525 -0.019189122 0.014777908 -0.043391259 -0.016462842 [41] -0.050019498 -0.025147288 -0.052831536 -0.050598406 -0.009729707 [46] 0.038536411 -0.024437070 -0.053220579 -0.086272810 -0.014950104 [51] -0.014230315 0.031645327 -0.034609832 -0.036814100 -0.015389660 [56] 0.033260407 0.020356596 0.012851383 -0.031679501 -0.089146249 > 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/3r21h1229611366.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/40b8g1229611366.tab") > > system("convert tmp/1nqrd1229611366.ps tmp/1nqrd1229611366.png") > system("convert tmp/28yr91229611366.ps tmp/28yr91229611366.png") > > > proc.time() user system elapsed 0.658 0.379 0.955