R version 2.7.0 (2008-04-22) 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 = '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/17w1r1229610954.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/296021229610954.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.00000000 0.77268329 0.40599629 0.10577258 -0.04226364 -0.07084150 [7] -0.06927627 -0.07785789 -0.05430268 0.07564162 0.33119975 0.64060750 [13] 0.81110559 0.59284192 0.25920862 -0.01719781 -0.15299305 -0.17937892 [19] -0.17710686 -0.17903439 -0.15341455 -0.03152801 0.19527183 0.46726189 [25] 0.60507001 0.40259139 0.10831693 -0.13127577 -0.24520602 -0.26155510 [31] -0.25452059 -0.25947843 -0.23934911 -0.13584407 0.06227647 0.30601733 [37] 0.42111774 0.23791560 -0.01829027 -0.22863072 -0.32509940 -0.33253327 [43] -0.31876981 -0.31785908 -0.29505135 -0.19797342 -0.01809401 0.19943456 [49] 0.29400004 0.13456278 -0.07400229 -0.23964445 -0.30937636 -0.31362449 [55] -0.30146150 -0.29686867 -0.26783663 -0.17621799 -0.01854789 0.16449785 [61] 0.23470574 > (mypacf <- c(rpacf$acf)) [1] 0.772683291 -0.474098991 0.030943801 0.059568401 -0.007024424 [6] -0.082305662 -0.027692701 0.111932441 0.263047442 0.363598606 [11] 0.448389381 0.243112475 -0.663829454 0.234944351 -0.116426762 [16] -0.125398920 -0.064481359 -0.008819005 -0.026630517 -0.107424729 [21] 0.033562928 -0.027965917 -0.001524090 0.003664363 -0.073689577 [26] 0.080876165 0.010339410 -0.047893164 0.026210248 -0.016771304 [31] -0.118152955 -0.001066537 -0.095222106 0.005252130 -0.018610061 [36] -0.048474495 -0.018511317 -0.011040637 -0.064363658 -0.019813181 [41] -0.004312901 -0.002271864 -0.006783755 0.001685054 0.035719840 [46] -0.038912529 -0.037790964 -0.002825947 0.031981092 0.063814408 [51] 0.011624800 0.009490393 -0.066211301 0.031387258 0.028147883 [56] -0.014877886 -0.034171650 -0.020819306 -0.063292155 0.012375732 > 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/3t1yj1229610954.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/4lvil1229610954.tab") > > system("convert tmp/17w1r1229610954.ps tmp/17w1r1229610954.png") > system("convert tmp/296021229610954.ps tmp/296021229610954.png") > > > proc.time() user system elapsed 1.550 0.552 1.645