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(80,79,78,76,74,73,74,76,77,77,78,80,90,90,89,82,78,76,74,78,81,82,88,99,117,113,106,100,97,96,100,104,104,111,117,118,140,147,134,126,116,114,120,122,117,119,132,134,154,152,132,130,123,129,124,128,128,129,141,138,155,160,142,133,131,140,134,134,134,136,145,137,152,168,160,157,147,161,159,164,163,158,175,163) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '0' > 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/10nai1282046896.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/20nai1282046896.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.938513831 0.864814053 0.805531968 0.750044557 [6] 0.708319997 0.661969370 0.630260406 0.608360788 0.600200394 [11] 0.589094931 0.570642795 0.565681629 0.523338980 0.463182514 [16] 0.411138482 0.364842330 0.331863551 0.293580073 0.259331645 [21] 0.233391398 0.226997815 0.219024800 0.192935405 0.177329725 [26] 0.144322561 0.096975314 0.058802261 0.023425948 -0.002720383 [31] -0.030013467 -0.049781688 -0.065606414 -0.072457451 -0.072128192 [36] -0.089723996 -0.107949374 -0.125845608 -0.148783522 -0.163196177 [41] -0.175629702 -0.192655657 -0.214033664 -0.224399291 -0.232893752 [46] -0.244583010 -0.259546974 -0.283573722 -0.299113113 > (mypacf <- c(rpacf$acf)) [1] 0.938513831 -0.134188421 0.093271578 -0.026842115 0.097586154 [6] -0.089486894 0.143197350 0.015679300 0.147362200 -0.070672321 [11] 0.021413736 0.097917608 -0.334322083 -0.066988844 0.006409796 [16] 0.022494564 -0.005610074 -0.046946356 -0.001147633 0.006130308 [21] 0.092103376 -0.088921533 -0.029419603 0.032885947 -0.131566850 [26] -0.054525764 0.054030555 -0.007814350 -0.032883833 -0.032626716 [31] 0.058849546 -0.016163680 -0.027498327 -0.003531317 -0.020186045 [36] -0.044669212 0.017756122 0.010545192 0.039870046 -0.001844303 [41] -0.113600736 -0.037181675 0.057915986 -0.054184515 -0.081826416 [46] -0.106794594 0.035048186 0.037772071 > 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/3wfp91282046896.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/4667u1282046896.tab") > > try(system("convert tmp/10nai1282046896.ps tmp/10nai1282046896.png",intern=TRUE)) character(0) > try(system("convert tmp/20nai1282046896.ps tmp/20nai1282046896.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.570 0.301 0.720