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(492865,480961,461935,456608,441977,439148,488180,520564,501492,485025,464196,460170,467037,460070,447988,442867,436087,431328,484015,509673,512927,502831,470984,471067,476049,474605,470439,461251,454724,455626,516847,525192,522975,518585,509239,512238,519164,517009,509933,509127,500857,506971,569323,579714,577992,565464,547344,554788,562325,560854,555332,543599,536662,542722,593530,610763,612613,611324,594167,595454,590865,589379,584428,573100,567456,569028,620735,628884,628232,612117,595404,597141,593408,590072,579799,574205,572775,572942,619567,625809,619916,587625,565742,557274,560576,548854,531673,525919,511038,498662,555362,564591,541657,527070,509846,514258,516922,507561,492622,490243,469357,477580,528379,533590) > 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/freestat/rcomp/tmp/11pi61229613507.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/2nhsk1229613507.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.0197506069 -0.0246656337 0.0002071329 0.0751932701 [6] 0.0794916001 0.0763622281 0.0165431616 0.1000008308 0.1071673484 [11] -0.0653463845 -0.0224167549 -0.2292000976 0.0055044253 0.2436182041 [16] 0.0031398932 -0.0049400980 -0.0801591530 0.0693039046 0.0716290830 [21] 0.0118666881 0.0587729323 0.0713753315 0.1863879274 -0.0875795663 [26] -0.1176725733 -0.1771212802 0.0840664555 -0.0282373079 0.1183917542 [31] -0.1040873605 -0.0913788228 0.0210175661 -0.0988748438 -0.0739353557 [36] -0.0326873083 0.0362874492 0.0973316211 0.1075040821 -0.1378221227 [41] -0.0713590160 0.0076276142 -0.0207084466 0.0649063957 -0.0848268098 [46] -0.0647512068 0.0051307532 -0.1475548021 -0.0867137413 -0.0980395958 [51] 0.0246014596 -0.0260101194 -0.0032296988 -0.1487189155 0.0134375623 [56] -0.0846228024 0.0014790032 0.0419860889 -0.0490092183 0.0193471295 [61] 0.0153879254 > (mypacf <- c(rpacf$acf)) [1] -0.0197506069 -0.0250654979 -0.0007881004 0.0746392904 0.0830546885 [6] 0.0848736553 0.0255692306 0.1018718459 0.1062924455 -0.0714001299 [11] -0.0378466244 -0.2731101348 -0.0651231981 0.2201937855 0.0267468638 [16] 0.0624742089 -0.0563959482 0.0863504748 0.0986569168 0.0344313443 [21] 0.1183566550 -0.0252351099 0.1325193945 -0.1618571162 -0.1943697369 [26] -0.1634503785 -0.0355010715 -0.1049586809 0.1091646980 -0.0200142116 [31] 0.0315375457 0.0899426764 0.0138548697 0.0036324529 0.0153007661 [36] -0.0424411896 -0.0701914727 0.0736974746 -0.0681261776 -0.0748358883 [41] -0.0510937033 -0.0843675966 -0.0177656487 -0.0171543029 -0.0438321367 [46] 0.0098247937 -0.0548622592 0.0163213166 -0.0289471832 0.0496656053 [51] -0.0286844292 -0.0950901221 -0.0293758394 0.0490025392 -0.0365589187 [56] -0.0208948150 0.0087833234 -0.0813014875 -0.0518924780 0.0068885248 > 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/3cq221229613507.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/4gw6v1229613507.tab") > > system("convert tmp/11pi61229613507.ps tmp/11pi61229613507.png") > system("convert tmp/2nhsk1229613507.ps tmp/2nhsk1229613507.png") > > > proc.time() user system elapsed 0.803 0.415 0.922