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(14532.2,15167,16071.1,14827.5,15082,14772.7,16083,14272.5,15223.3,14897.3,13062.6,12603.8,13629.8,14421.1,13978.3,12927.9,13429.9,13470.1,14785.8,14292,14308.8,14013,13240.9,12153.4,14289.7,15669.2,14169.5,14569.8,14469.1,14264.9,15320.9,14433.5,13691.5,14194.1,13519.2,11857.9,14616,15643.4,14077.2,14887.5,14159.9,14643,17192.5,15386.1,14287.1,17526.6,14497,14398.3,16629.6,16670.7,16614.8,16869.2,15663.9,16359.9,18447.7,16889,16505,18320.9,15052.1,15699.8,18135.3,16768.7,18883,19021,18101.9,17776.1,21489.9,17065.3,18690,18953.1,16398.9,16895.7,18553,19270,19422.1,17579.4,18637.3,18076.7,20438.6,18075.2,19563,19899.2,19227.5,17789.6,19220.8,22058.6,21230.8,19504.4,23913.1,23165.7,23574.3,25002,22603.9,23408.6) > 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/freestat/rcomp/tmp/1ie581229964475.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/freestat/rcomp/tmp/28a681229964475.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.410039943 -0.234590107 0.322876452 -0.151274387 [6] -0.122474282 0.301972058 -0.196803627 -0.038613603 0.201598845 [11] -0.254909996 -0.128028773 0.549358428 -0.261820536 -0.115842539 [16] 0.144993142 -0.132637397 0.033975050 0.120541837 -0.122824689 [21] 0.022056119 0.057984200 -0.200069119 0.073706986 0.201817832 [26] -0.054340033 -0.059494732 0.001358140 -0.038615765 0.090137028 [31] -0.065820685 0.002870806 0.032048771 -0.026734623 -0.109586670 [36] 0.032419836 0.150241971 0.015315909 -0.121382790 0.009071303 [41] 0.021181693 0.033798451 -0.072588339 0.061209200 0.019252326 [46] -0.084216566 0.040594611 -0.085240889 0.150199146 0.057232619 [51] -0.152652768 0.011523947 0.054903334 -0.054452998 0.039367465 [56] -0.001250047 -0.033876556 -0.009286432 0.022157856 -0.111339350 [61] 0.170725650 > (mypacf <- c(rpacf$acf)) [1] -0.4100399433 -0.4841191477 -0.0288759086 -0.1254097694 -0.1778644159 [6] 0.1199284684 -0.0393000091 0.0064983164 0.0792290265 -0.1575139369 [11] -0.3854960988 0.2562285778 0.2227247440 0.2102610354 -0.0913547398 [16] -0.1597292738 -0.0031738753 -0.0641667051 0.0242650751 -0.0192304371 [21] -0.0443906157 -0.1064135969 0.0495114559 -0.0428785286 0.1565033378 [26] 0.1183830246 0.1000324007 0.0575625528 0.0329839576 -0.1357500497 [31] -0.1417827858 -0.0913189138 0.0633496529 0.0842688925 -0.1385876989 [36] 0.0175282934 0.0359565490 0.0040744318 0.0065909193 0.0003947835 [41] 0.0453092023 -0.0298283890 -0.0044567055 0.0448894891 -0.0603667348 [46] 0.1504455509 0.0464761937 0.0512265012 -0.0349886892 -0.0698678494 [51] -0.0671160394 -0.0859674824 -0.0724314712 0.0844430029 0.0357299966 [56] -0.0356955093 -0.0213035811 -0.0338862667 0.0077791715 0.0217341380 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/html/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/3ez6x1229964475.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/freestat/rcomp/tmp/4r9ap1229964475.tab") > > system("convert tmp/1ie581229964475.ps tmp/1ie581229964475.png") > system("convert tmp/28a681229964475.ps tmp/28a681229964475.png") > > > proc.time() user system elapsed 0.835 0.431 0.940