R version 2.9.0 (2009-04-17) Copyright (C) 2009 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 = '1' > 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/rcomp/tmp/16h6b1248789706.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/2zcyi1248789706.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.184493754 0.037828657 0.075513008 -0.187015439 [6] -0.006846847 -0.184935351 0.023601006 -0.209748853 0.070397138 [11] -0.100660862 -0.097249627 0.644444351 -0.216651198 0.146136014 [16] 0.051877930 -0.186864560 0.054804490 -0.125383079 -0.018920617 [21] -0.149880183 0.073934220 -0.210256387 0.012271733 0.503991640 [26] -0.189681617 0.133073357 0.021961447 -0.137495614 0.034128072 [31] -0.123618061 0.017308417 -0.113110694 0.036176652 -0.137925288 [36] 0.051932387 0.298075756 -0.146758698 0.209858642 -0.059315435 [41] -0.090902996 0.048360785 -0.116515110 0.000907928 -0.107173344 [46] 0.052403352 -0.128856429 0.050298734 0.228409742 > (mypacf <- c(rpacf$acf)) [1] -0.184493754 0.003924286 0.086121456 -0.164762218 -0.078122651 [6] -0.208288218 -0.024001366 -0.255312513 -0.016312585 -0.203999950 [11] -0.193751548 0.564819648 -0.054298932 0.011836216 -0.021870403 [16] -0.136569807 0.073274648 0.037721799 -0.112026068 0.015189986 [21] -0.017132914 -0.135611006 0.069921284 0.183458078 0.042127936 [26] -0.141474525 -0.061923452 0.017071687 -0.025926992 -0.052490160 [31] 0.046071731 -0.067902486 -0.026830740 0.180357131 -0.035749342 [36] -0.119925376 0.006860848 0.074425504 -0.062687046 0.040995892 [41] -0.020496650 -0.059118996 -0.011744655 -0.033200308 0.048956683 [46] 0.033331804 -0.064473556 -0.012271408 > 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/3vnji1248789706.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/4h5iz1248789706.tab") > > system("convert tmp/16h6b1248789706.ps tmp/16h6b1248789706.png") > system("convert tmp/2zcyi1248789706.ps tmp/2zcyi1248789706.png") > > > proc.time() user system elapsed 0.575 0.315 0.687