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 = '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/freestat/rcomp/tmp/18vr71229087666.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/26np71229087666.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.36238828 -0.31397753 0.27563596 -0.02403612 -0.28228959 [7] 0.44294096 -0.35208739 0.05794675 0.23869192 -0.26899733 -0.24507127 [13] 0.66931959 -0.26512761 -0.16070734 0.16451112 -0.05218290 -0.17488797 [19] 0.31433620 -0.24060928 0.06697532 0.12059111 -0.17908439 -0.11300161 [25] 0.41083881 -0.16565265 -0.10268370 0.07361475 -0.01590590 -0.13096351 [31] 0.17453018 -0.10883058 0.07909229 0.06142832 -0.13609911 -0.10898780 [37] 0.28624391 -0.06622753 -0.10815195 0.01785394 0.06768971 -0.09445946 [43] 0.06329833 -0.04152438 0.05272576 0.02816174 -0.06693229 -0.07838888 [49] 0.14108308 > (mypacf <- c(rpacf$acf)) [1] -0.3623882849 -0.5126231775 -0.1284218463 -0.1339894167 -0.3717443003 [6] 0.2031419001 -0.4298929180 0.1091585191 -0.0339188484 -0.2602239212 [11] -0.4361064412 0.1011665059 0.0925039972 0.1005193474 0.0314957798 [16] 0.0005741132 -0.0106025368 -0.1271288267 0.0764768547 0.0212780375 [21] -0.0618889808 -0.0552660007 0.0280271905 0.0480272110 0.1284036158 [26] 0.0301152784 0.0231001931 0.0127903895 -0.0616243059 -0.0735819274 [31] -0.0923013968 0.0160549631 0.0727691290 0.0412456256 -0.0845958197 [36] -0.0656669102 -0.0517233582 -0.0931175334 -0.1225727154 0.0076846240 [41] 0.0609619552 0.0198861470 0.0321030858 -0.0298865401 -0.0713412048 [46] -0.0961442502 0.0582899566 -0.0795694137 > 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/3gqgr1229087666.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/45cvq1229087666.tab") > > system("convert tmp/18vr71229087666.ps tmp/18vr71229087666.png") > system("convert tmp/26np71229087666.ps tmp/26np71229087666.png") > > > proc.time() user system elapsed 0.814 0.442 1.169