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(189917,184128,175335,179566,181140,177876,175041,169292,166070,166972,206348,215706,202108,195411,193111,195198,198770,194163,190420,189733,186029,191531,232571,243477,227247,217859,208679,213188,216234,213587,209465,204045,200237,203666,241476,260307,243324,244460,233575,237217,235243,230354,227184,221678,217142,219452,256446,265845,248624,241114,229245,231805,219277,219313,212610,214771,211142,211457,240048,240636,230580) > 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/1i6jh1228322396.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/2owy71228322396.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.850979388 0.635387457 0.492618154 0.434971339 [6] 0.422061401 0.397861779 0.362059523 0.302294058 0.290211590 [11] 0.336736454 0.479176606 0.560863422 0.415980384 0.212835945 [16] 0.080755890 0.028456816 0.013385931 -0.004298205 -0.041698457 [21] -0.097111617 -0.116861105 -0.084648608 0.029616806 0.099939695 [26] 0.006415527 -0.135997005 -0.226176891 -0.263769549 -0.272342267 [31] -0.282602330 -0.300414727 -0.334528043 -0.347130287 -0.320392443 [36] -0.235650130 -0.170161604 -0.213651280 -0.279456898 -0.312765932 [41] -0.305994939 -0.285905220 -0.268141974 -0.251955411 -0.250669171 [46] -0.239585936 -0.212781061 -0.149764869 -0.096461680 -0.096984561 [51] -0.108473024 -0.111926544 -0.091395594 -0.078727345 -0.066704704 [56] -0.064335017 -0.066746486 -0.065682065 -0.057740854 -0.031738503 [61] -0.011235833 > (mypacf <- c(rpacf$acf)) [1] 0.8509793885 -0.3218545828 0.2094183235 0.0998446230 0.0740912274 [6] -0.0275695623 0.0518363285 -0.0926060882 0.2275127957 0.0974051124 [11] 0.4660232747 -0.2940161010 -0.6084349782 0.1000489342 0.0958087831 [16] -0.2152322844 0.0716966346 -0.0762087213 0.0138205170 -0.0104607028 [21] 0.0124087467 -0.0262126775 -0.1204396298 0.0607732024 0.1769939062 [26] -0.1565879765 -0.0700695900 -0.1126228572 0.0357992584 -0.0853213685 [31] 0.1299917511 -0.1389142421 -0.0677310334 -0.0512897871 0.0122455231 [36] 0.0087993442 0.0807088198 -0.0242374106 0.0859307571 0.0166475692 [41] 0.0660320272 -0.0798256495 0.0220881733 0.0084648617 0.0184870077 [46] -0.0762859553 0.0271218494 -0.0548385584 0.1466484113 -0.1188881678 [51] -0.0201314129 0.0115948971 -0.0520638294 0.0097662162 -0.1093576036 [56] -0.0005884482 0.0310199365 -0.0322697139 0.0324645408 -0.0419949459 > 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/3p4ng1228322396.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/4q9yy1228322396.tab") > > system("convert tmp/1i6jh1228322396.ps tmp/1i6jh1228322396.png") > system("convert tmp/2owy71228322396.ps tmp/2owy71228322396.png") > > > proc.time() user system elapsed 0.595 0.322 0.718