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(493,481,462,457,442,439,488,521,501,485,464,460,467,460,448,443,436,431,484,510,513,503,471,471,476,475,470,461,455,456,517,525,523,519,509,512,519,517,510,509,501,507,569,580,578,565,547,555,562,561,555,544,537,543,594,611,613,611,594,595,591,589,584,573,567,569,621,629,628,612,595,597,593,590,580,574,573,573,620,626,620,588,566,557,561,549,532,526,511,499,555,565,542,527,510,514,517,508,493,490,469,478,528,534,518,506) > par5 = '12' > par4 = '1' > 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/1tzek1230045356.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/2kteu1230045356.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.0000000000 -0.0152387606 -0.0317775653 0.0120536047 0.0952483759 [6] 0.0726150245 0.0815450093 0.0228972272 0.0961312827 0.1249940199 [11] -0.0398932193 -0.0123588291 -0.2339593152 0.0019236604 0.2606583555 [16] -0.0060681915 -0.0426491863 -0.0669222160 0.0532228666 0.0642831124 [21] 0.0138073060 0.0534364466 0.0588078199 0.1619127012 -0.0946644445 [26] -0.1241301033 -0.1768399479 0.0723944246 -0.0104975771 0.1179798640 [31] -0.0970996459 -0.0979020671 0.0143559552 -0.0852347268 -0.0788180349 [36] -0.0501590782 0.0216107766 0.0964165835 0.0867459366 -0.1278675198 [41] -0.0755568164 0.0084587373 -0.0212918369 0.0561499086 -0.0854138970 [46] -0.0856710167 -0.0006592027 -0.1271357035 -0.0665152840 -0.1030962788 [51] 0.0218904777 -0.0366629615 0.0013208402 -0.1608587599 0.0016519125 [56] -0.0704736858 -0.0057418059 0.0469538162 -0.0481555815 0.0008587835 [61] 0.0023621009 > (mypacf <- c(rpacf$acf)) [1] -0.0152387606 -0.0320172202 0.0110798753 0.0947213007 0.0771662564 [6] 0.0916419161 0.0304068603 0.0949710833 0.1208640919 -0.0468825171 [11] -0.0253874397 -0.2839383952 -0.0739941089 0.2318498426 0.0087660189 [16] 0.0231078000 -0.0629522324 0.0510490723 0.0986745634 0.0460180493 [21] 0.1364322932 -0.0170110715 0.1024553581 -0.1725574563 -0.2128836363 [26] -0.1517915720 -0.0367539508 -0.1062494977 0.1243413036 -0.0060934157 [31] 0.0258540028 0.0917050035 0.0243898215 0.0159412355 -0.0069313028 [36] -0.0677932709 -0.0694319032 0.0491050151 -0.0345347206 -0.0758660804 [41] -0.0339522617 -0.0755382634 -0.0233608710 -0.0090500663 -0.0400000360 [46] 0.0061887288 -0.0576674613 0.0114695675 -0.0488453403 0.0384317608 [51] -0.0498426445 -0.0906468406 -0.0495759832 0.0730188521 -0.0067187628 [56] 0.0007108973 0.0317966093 -0.0731368026 -0.0627227133 -0.0279308203 > 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/34w2u1230045356.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/48zmj1230045356.tab") > > system("convert tmp/1tzek1230045356.ps tmp/1tzek1230045356.png") > system("convert tmp/2kteu1230045356.ps tmp/2kteu1230045356.png") > > > proc.time() user system elapsed 1.814 0.569 1.913