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(3258.1,3140.1,3627.4,3279.4,3204,3515.6,3146.6,2271.7,3627.9,3553.4,3018.3,3355.4,3242,3311.1,4125.2,3423,3120.3,3863,3240.8,2837.4,3945,3684.1,3659.6,3769.6,3592.7,3754,4507.8,3853.2,3817.2,3958.4,3428.9,3125.7,3977,3983.3,4299.6,4306.9,4259.5,3986,4755.6,3925.6,4206.5,4323.4,3816.1,3410.7,4227.4,4296.9,4351.7,3800,4277,4100.2,4672.5,4189.9,4231.9,4654.9,4298.5,3635.9,4505.1,4891.9,4894.2,4093.2) > 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/rcomp/tmp/1cen51229087585.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/2fan91229087585.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.53904886 0.38598857 0.53002538 0.41989256 0.34185544 [7] 0.51678077 0.27482985 0.32519698 0.36826903 0.18599829 0.23557539 [13] 0.51281693 0.19177089 0.10168606 0.18333228 0.09429415 0.05431983 [19] 0.18952152 0.01292869 0.03966540 0.04682408 -0.07685055 -0.02911714 [25] 0.11887750 -0.10963647 -0.18464343 -0.13757423 -0.17851711 -0.19300416 [31] -0.08975754 -0.16968141 -0.16057231 -0.19530263 -0.29590469 -0.25215882 [37] -0.10759693 -0.22449195 -0.28936555 -0.23166944 -0.22183686 -0.24584806 [43] -0.18694953 -0.21173337 -0.20138833 -0.21602401 -0.26486566 -0.23891539 [49] -0.15973744 > (mypacf <- c(rpacf$acf)) [1] 0.5390488627 0.1344958472 0.3982853527 0.0104371280 0.0672598534 [6] 0.2904048648 -0.2981643311 0.3038514937 -0.2097277941 -0.0514805710 [11] 0.1754153231 0.2587950839 -0.2748358372 -0.1308039442 -0.1101513191 [16] -0.0196484849 -0.0130640890 0.0025521537 0.0583180159 -0.0841900348 [21] -0.0586265394 0.0116979416 0.0354902386 -0.0966110285 -0.0483243397 [26] -0.1650814396 -0.0044383861 -0.0079888967 0.0002042198 0.0689117966 [31] 0.0263435649 -0.0018343758 -0.1187378473 -0.1111132088 -0.0510742196 [36] 0.0961814450 0.0398016565 -0.0031103889 0.0572106120 -0.0072000979 [41] -0.0556089739 -0.0889137067 -0.0297967256 0.0013122146 -0.0041492671 [46] 0.0560149904 0.0021922949 -0.1283767878 > 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/3mjwn1229087585.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/4hp701229087586.tab") > > system("convert tmp/1cen51229087585.ps tmp/1cen51229087585.png") > system("convert tmp/2fan91229087585.ps tmp/2fan91229087585.png") > > > proc.time() user system elapsed 0.569 0.319 0.737