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(13,14,8,10,16,26,32,27,18,32,36,24,22,23,22,18,25,21,21,14,8,11,14,23,18,17,19,20,22,19,13,26,13,14,22,24,21,22,26,21,23,24,27,41,31,27,35,26,28,36,39,21,17,22,17,19,15,34,10,15,22,18,15,20,15,22,19,16,30,27,29,23,20,16,21,21,25,16,18,15,18,14,10,15,8,15,6,11,8,7,13,10,23,16,15,25,22,20,16) > 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/14i7l1272891553.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/html/rcomp/tmp/24i7l1272891553.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.000000000 -0.366192647 -0.120145833 0.064100983 0.014771714 [6] -0.007853474 -0.077624062 0.144559624 -0.032282773 -0.040925933 [11] -0.127576277 0.086966753 0.020218362 -0.030124128 -0.043780991 [16] 0.080694456 -0.156980575 0.061888303 -0.067393799 0.158563267 [21] -0.070475356 -0.053108842 0.177543110 -0.143585173 -0.064652314 [26] 0.016693498 0.164125850 -0.070858901 0.045530421 -0.114333956 [31] 0.083342421 -0.074626531 0.039972183 0.045094868 0.040270944 [36] -0.023948759 -0.087279709 0.116648510 -0.083441221 0.038979394 [41] 0.056359009 -0.070907566 -0.028177744 0.029239431 0.005218878 [46] 0.010937705 -0.083565110 0.117081055 -0.103229445 > (mypacf <- c(rpacf$acf)) [1] -0.3661926472 -0.2936159182 -0.1268034166 -0.0531828051 -0.0184250871 [6] -0.1032464307 0.0831245392 0.0502617832 0.0227222080 -0.1771073648 [11] -0.0850702881 -0.0527352752 -0.0158110533 -0.0935998723 0.0163922104 [16] -0.1912389050 -0.0414587417 -0.1890789545 0.0656089844 -0.0627865177 [21] -0.0244751027 0.1206184252 0.0076123141 -0.1626618172 -0.1413941172 [26] -0.0257059548 0.0103227247 0.1094814211 -0.0878255492 -0.0088828074 [31] -0.1107522089 -0.0030509315 -0.0281347009 0.0393114421 0.0784943262 [36] 0.0445602690 0.1041258810 0.0001586328 -0.0624934889 0.0749197774 [41] -0.0903709765 0.0207875723 0.0447162396 0.0791586702 0.0209400466 [46] -0.0414189650 0.0052361768 -0.0845617862 > 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/3irnu1272891553.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/4bj4f1272891553.tab") > > try(system("convert tmp/14i7l1272891553.ps tmp/14i7l1272891553.png",intern=TRUE)) character(0) > try(system("convert tmp/24i7l1272891553.ps tmp/24i7l1272891553.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.578 0.320 0.714