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(33,24,24,31,25,28,24,25,16,17,11,12,39,19,14,15,7,12,12,14,9,8,4,7,3,5,0,-2,6,11,9,17,21,21,41,57,65,68,73,71,71,70,69,65,57,57,57,55,65,65,64,60,43,47,40,31,27,24,23,17) > par8 = '' > 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/html/rcomp/tmp/1wu6v1292427376.ps",horizontal=F,onefile=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/html/rcomp/tmp/2wu6v1292427376.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.0044603723 0.0915654154 0.2516067920 -0.0887696717 [6] 0.1308371511 0.0565475363 0.0975044473 -0.0799401192 0.0097648186 [11] -0.0879857513 -0.0491335170 0.0445744334 0.0408895005 -0.0001121760 [16] -0.1198277299 -0.0199192368 -0.0157632172 -0.2004451891 -0.0145905717 [21] -0.0881579934 -0.2979361718 -0.0073842047 -0.0079018055 -0.1092994501 [26] -0.0316757693 -0.0171098536 -0.1368821512 -0.0359367953 0.0104468801 [31] -0.0160284002 0.0473990298 -0.0467457337 -0.0216461174 -0.0274718367 [36] -0.0764589042 0.1295397392 -0.0134149534 0.0342635109 0.0868374120 [41] -0.1787766016 0.0810357367 0.0208340437 -0.0057495655 0.0159402682 [46] 0.0082265301 0.0725309087 -0.0678084136 0.0365518834 > (mypacf <- c(rpacf$acf)) [1] 0.004460372 0.091547342 0.252952393 -0.100608185 0.091205670 [6] 0.010220881 0.137249035 -0.169642396 0.006672854 -0.154760498 [11] 0.048001735 -0.008947409 0.153401535 -0.058150943 -0.088411639 [16] -0.079346829 0.077461387 -0.243183503 -0.003121052 -0.129448434 [21] -0.155589801 -0.023043066 0.175104273 -0.032695270 -0.050345600 [26] -0.056868393 -0.047402187 -0.055138452 -0.033328817 0.014360425 [31] 0.039831529 -0.045268464 0.009094606 0.020242443 -0.139773337 [36] 0.044997472 -0.047138547 0.079320647 -0.095306273 -0.148720368 [41] 0.026295035 -0.029654711 -0.011819468 -0.024441533 -0.027682034 [46] 0.055261847 -0.050233567 -0.059255353 > 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/30d5j1292427376.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/43dlp1292427376.tab") > > try(system("convert tmp/1wu6v1292427376.ps tmp/1wu6v1292427376.png",intern=TRUE)) character(0) > try(system("convert tmp/2wu6v1292427376.ps tmp/2wu6v1292427376.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.577 0.353 1.345