R version 2.12.0 (2010-10-15) Copyright (C) 2010 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-pc-linux-gnu (32-bit) 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(19437.50,18885.1,16579,17203.6,19165.7,17107.6,17690.5,18664.9,15878.6,16014.6,16842.6,15986.9,16773.3,16263.1,13597.3,14285.6,15496.8,13916.8,14345.5,15761.3,14531.6,15076.6,15816.8,17180.4,20432.3,21289.5,18203.6,20159.5,21053.2,19673.6,21473.3,20244.7,19049.6,20194.3,18021.9,19537.3,20286.6,17967.7,16409.9,17802.7,18509.9,18161.3,16721.3,19106.9,16772.1,17463.6,16162.3,17862.9,17664.9,17180.8,15672.7,15189.8,17699.4,17444.6,15930.7,19691.6,16698,16896.2,17972.4,17637.4,15214) > par8 = '' > par7 = '' > par6 = 'MA' > par5 = '12' > par4 = '1' > par3 = '1' > 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/rcomp/tmp/1yxgw1293255030.ps",horizontal=F,onefile=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/rcomp/tmp/2yxgw1293255030.ps",horizontal=F,onefile=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.0000000000 -0.2012778895 0.0124445982 0.4392697574 -0.2442408849 [6] 0.1661001824 0.2079994550 -0.3794537432 0.0746595543 0.0276533012 [11] -0.2304188190 0.0292059093 -0.1883810114 -0.2038695931 0.0218463641 [16] -0.0099190386 -0.1493563627 0.0091421483 -0.0946762955 -0.0234685225 [21] 0.1854876722 -0.1915619356 0.0185826179 0.1842933713 -0.0733887817 [26] 0.1141520200 0.1155212387 -0.1338429479 0.1096246524 0.0746743611 [31] -0.0238083309 0.0257018373 0.0102001299 -0.0162411895 0.0243131245 [36] 0.0056518758 -0.1104773047 -0.0396208526 0.0265776877 -0.0386213334 [41] -0.0393356302 0.0027832125 -0.0193597234 0.0070666243 0.0061525775 [46] 0.0063320324 0.0066450881 -0.0007612035 > (mypacf <- c(rpacf$acf)) [1] -0.201277890 -0.029253324 0.454756663 -0.089897132 0.098242015 [6] 0.094240065 -0.278941567 -0.221210211 -0.057772284 0.036297565 [11] -0.083143457 -0.184070920 -0.120249487 -0.098194509 0.149310956 [16] 0.003292471 -0.003438304 -0.171384844 -0.095910695 0.121120211 [21] -0.174876013 -0.037186222 0.084633354 0.077700232 -0.096298713 [26] -0.008701679 0.058803762 -0.133129205 -0.087207284 0.102701012 [31] -0.020610649 -0.015779059 0.020267222 0.015216374 -0.114204024 [36] -0.063788937 0.015940631 -0.013578507 -0.009434946 -0.021757554 [41] 0.064051910 0.017732285 -0.020304579 0.014534475 -0.010756661 [46] -0.015706853 -0.022877858 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/rcomp/tmp/3upen1293255030.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/rcomp/tmp/45gv81293255030.tab") > > try(system("convert tmp/1yxgw1293255030.ps tmp/1yxgw1293255030.png",intern=TRUE)) character(0) > try(system("convert tmp/2yxgw1293255030.ps tmp/2yxgw1293255030.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.72 0.21 0.90