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 = '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/1iehi1229613153.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/2ims51229613153.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.93048678 0.82332068 0.73831636 0.69072864 0.68058200 [7] 0.66721832 0.63577094 0.60338799 0.60366798 0.63605513 0.68923009 [13] 0.70615639 0.61669784 0.50031302 0.39925892 0.33238073 0.30055607 [19] 0.26634191 0.22071412 0.17632224 0.16684261 0.18842707 0.22234643 [25] 0.22328580 0.13772823 0.03441807 -0.05017429 -0.10486729 -0.13189324 [31] -0.16197705 -0.19723697 -0.23062736 -0.23268125 -0.20797884 -0.16981182 [37] -0.15898141 -0.22341555 -0.30449446 -0.36906012 -0.40195082 -0.41054398 [43] -0.41948938 -0.43201044 -0.44308072 -0.42643806 -0.38886014 -0.34104399 [49] -0.31458520 -0.35004744 -0.39964609 -0.43473568 -0.44673997 -0.43947428 [55] -0.42910104 -0.42251440 -0.41285596 -0.38065505 -0.33259158 -0.27602735 [61] -0.23976504 > (mypacf <- c(rpacf$acf)) [1] 0.9304867841 -0.3165929185 0.2010413766 0.1347457363 0.1827822920 [6] -0.1082109174 0.0011584855 0.0913373492 0.2666164836 0.1092045813 [11] 0.2070505440 -0.2210877421 -0.6609850406 0.1193979645 -0.1771201992 [16] -0.0734359485 -0.0728267271 -0.0056695043 0.0245641375 -0.0507537116 [21] 0.1471162471 -0.0052660247 -0.0977304064 0.0728188735 -0.1402584719 [26] 0.0659989814 0.0541287514 -0.0835403060 -0.0228334179 -0.0243388592 [31] 0.0740998368 -0.1108916397 -0.0691516133 0.0330995680 0.0561795794 [36] -0.0146532811 -0.0713120818 -0.0652896667 -0.0030324722 0.0666580617 [41] -0.0537178171 0.0783149105 -0.0503055736 0.0490441849 -0.0064147617 [46] -0.0432804097 0.0140472574 0.0135350977 -0.0001119666 0.0180076474 [51] 0.0250168762 -0.0842466824 -0.0139618280 0.0187411242 -0.0410209602 [56] 0.0504395407 -0.0726926123 0.0387965911 -0.0078950907 -0.0073137450 > 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/32tll1229613153.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/4obuj1229613153.tab") > > system("convert tmp/1iehi1229613153.ps tmp/1iehi1229613153.png") > system("convert tmp/2ims51229613153.ps tmp/2ims51229613153.png") > > > proc.time() user system elapsed 0.589 0.311 0.800