R version 2.11.1 (2010-05-31) Copyright (C) 2010 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(94,93,92,90,110,109,94,84,85,85,86,88,93,94,90,91,104,103,88,79,82,88,93,89,94,96,94,92,113,122,107,98,103,110,113,110,123,124,118,117,139,146,134,121,123,122,127,122,139,136,127,123,140,146,138,120,122,115,115,102,119,114,108,102,121,109,102,95,98,92,94,90,113,111,103,90,108,99,95,91,85,72,90,90,114,115,104,93,101,90,79,75,71,61,84,87,107,99,93,74,87,71,67,61,63,52,80,84,102,93,87,72,83,72,66,64,64,47,77,79) > par7 = '0.95' > par6 = 'White Noise' > 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: > 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 (par6 == 'White Noise') par6 <- 'white' else par6 <- 'ma' > par7 <- as.numeric(par7) > 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/1o86j1281451047.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > racf <- acf(x, par1, main='Autocorrelation', xlab='time lag', ylab='ACF', ci.type=par6, ci=par7, sub=paste('(lambda=',par2,', d=',par3,', D=',par4,', CI=', par7, ', CI type=',par6,')',sep='')) > dev.off() null device 1 > postscript(file="/var/www/rcomp/tmp/2o86j1281451047.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.0000000000 -0.1166839114 -0.0623640575 -0.2795929184 0.2480949656 [6] -0.3212203571 0.1258740476 -0.2479564306 0.2526934356 -0.2808002494 [11] -0.0084014005 -0.0796881688 0.8008590768 -0.1120150880 -0.0986809691 [16] -0.2314512395 0.2082430481 -0.3243766844 0.0998877803 -0.1617430080 [21] 0.2458747148 -0.2356007341 -0.0160040449 -0.0817788499 0.6294488415 [26] -0.1088767531 -0.1081233845 -0.1866522603 0.1499707614 -0.2988738642 [31] 0.0723250915 -0.0481822852 0.2390645682 -0.2138515610 0.0007806865 [36] -0.0833060857 0.4749811569 -0.1290619851 -0.0495879800 -0.1465372250 [41] 0.1092706140 -0.2752022407 0.0941557192 0.0032561602 0.2308225360 [46] -0.1814802219 0.0003099103 -0.0620125682 0.3073411046 > (mypacf <- c(rpacf$acf)) [1] -0.116683911 -0.077027939 -0.302303383 0.184079063 -0.371744124 [6] 0.061806801 -0.287256812 0.071311518 -0.299964186 -0.322434095 [11] -0.018683964 0.654674906 0.112812380 -0.077835430 0.107114149 [16] -0.077181957 0.032937374 -0.035066707 -0.017577499 0.051295598 [21] 0.051419608 -0.085081077 -0.134382947 -0.047967791 -0.056939893 [26] -0.028499376 -0.027996379 -0.145735617 -0.001039025 -0.080620230 [31] 0.064153664 0.027448008 -0.078475616 0.139333199 -0.067694861 [36] -0.003586233 -0.119203316 0.151164761 0.035397814 -0.032537701 [41] 0.055691090 -0.032432832 0.066186911 -0.053040617 0.061700977 [46] -0.052357996 0.106376795 -0.135616236 > 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/3ki4s1281451047.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/45ilg1281451047.tab") > > try(system("convert tmp/1o86j1281451047.ps tmp/1o86j1281451047.png",intern=TRUE)) character(0) > try(system("convert tmp/2o86j1281451047.ps tmp/2o86j1281451047.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.800 0.290 1.049