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(6430,5124,4836,4629,4597,4490,4517,4560,4135,4559,4739,4886,5605,4616,4997,4607,4882,4555,4462,4476,4277,4369,4492,5183,6039,4923,4953,4892,4614,4363,4675,4556,4217,4664,4601,5428,5607,4869,5174,5031,4671,4491,4504,4615,4582,4800,4775,5791,5818,4714,4915,4598,4407,4383,4412,4274,4236,4637,4534,5271,5467,5204,5752,4724,4623,4451,4138,4140,4169,4603,4434,5185) > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '1' > par1 = '48' > #'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/1ys4k1248789219.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/21jie1248789219.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.450925955 0.225348617 -0.009372956 -0.280859063 [6] -0.377970506 -0.458089623 -0.380313731 -0.333089527 -0.051955206 [11] 0.095244724 0.330063599 0.632040422 0.274584726 0.236988091 [16] 0.022765892 -0.188503776 -0.259717867 -0.350907223 -0.317517564 [21] -0.269366423 -0.068451448 0.047334335 0.347380298 0.535872857 [26] 0.174462858 0.128414406 -0.043669983 -0.224700811 -0.252472950 [31] -0.282766197 -0.233141458 -0.192019086 -0.021152387 0.066227799 [36] 0.293699985 0.367875519 0.154734249 0.173033240 -0.035180907 [41] -0.164409788 -0.182635388 -0.229911681 -0.165021077 -0.119854085 [46] 0.019004272 0.084945141 0.271271891 0.276163369 > (mypacf <- c(rpacf$acf)) [1] 0.450925955 0.027633169 -0.151548169 -0.295168186 -0.179239232 [6] -0.237538613 -0.138328232 -0.261107820 0.025167444 -0.095621310 [11] 0.131131062 0.405655756 -0.340274590 0.073028963 -0.048261348 [16] -0.059271153 0.061740731 -0.077360022 -0.030949281 0.025843134 [21] -0.112839734 0.061262341 0.175577389 0.104357186 -0.258118379 [26] -0.179856891 0.045730210 -0.117426824 -0.011100401 0.033794710 [31] -0.033288840 -0.059769407 -0.062559114 -0.072837727 -0.080662203 [36] -0.088564237 0.072123554 0.008501616 -0.110213940 0.001801964 [41] -0.033158389 -0.013210618 0.078933925 -0.002356189 0.070228037 [46] -0.043527722 -0.118161614 0.057321603 > 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/3palo1248789219.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/4ucev1248789219.tab") > > system("convert tmp/1ys4k1248789219.ps tmp/1ys4k1248789219.png") > system("convert tmp/21jie1248789219.ps tmp/21jie1248789219.png") > > > proc.time() user system elapsed 0.797 0.417 0.976