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(210,209,208,206,226,225,210,200,201,201,202,204,197,196,187,196,221,218,200,191,194,192,199,196,182,178,169,177,207,213,191,182,188,189,194,195,171,165,156,170,201,208,189,175,184,187,193,199,179,188,171,182,212,216,192,182,183,183,187,190,167,167,158,171,201,208,181,169,173,180,181,192,169,168,156,161,195,208,176,164,170,175,170,175,148,151,143,139,166,186,149,142,138,137,130,138,118,113,99,93,125,146,109,97,97,94,92,103,78,72,57,40,70,89,53,46,43,38,29,34) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > 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: > 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/1o8931281709170.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/2o8931281709170.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.0725622435 -0.4091229204 -0.2435198112 -0.1425130633 [6] 0.0466885044 0.4528806663 0.0832737855 -0.1288721468 -0.2482673649 [11] -0.3778999155 0.0342442138 0.8621568909 0.1148286328 -0.3560816784 [16] -0.2321352640 -0.1328446564 0.0207322812 0.3941540424 0.0918256556 [21] -0.0968517751 -0.2332932374 -0.3346125272 -0.0045809716 0.7462736237 [26] 0.1433687939 -0.3161956900 -0.2037514373 -0.1337246425 -0.0007307744 [31] 0.3370113501 0.1061306975 -0.0858786512 -0.2054157284 -0.2929129306 [36] -0.0316215639 0.6174152414 0.1766388760 -0.2792491752 -0.1972656908 [41] -0.1110952742 -0.0132834103 0.2745487835 0.0929623741 -0.0723581767 [46] -0.1650333943 -0.2481117360 -0.0376354958 0.4822529784 0.1783998483 [51] -0.2381385670 -0.1524619228 -0.0874432986 -0.0303440109 0.2133902905 [56] 0.0848958289 -0.0650843245 -0.1183851372 -0.1936728127 -0.0515652258 [61] 0.3815222499 > (mypacf <- c(rpacf$acf)) [1] 0.072562243 -0.416581618 -0.208291107 -0.362610111 -0.218798814 [6] 0.246810897 -0.064929389 0.216511283 -0.136515212 -0.397105477 [11] -0.184535379 0.714340719 0.009014124 0.200909605 0.043051479 [16] 0.150491246 0.060625217 -0.122099332 -0.083865379 -0.036883273 [21] -0.025375039 0.029370522 -0.061981668 0.083942319 0.013460796 [26] -0.004849194 0.069830250 -0.097974963 0.047337967 -0.104421183 [31] 0.041363820 -0.113549840 0.037512413 -0.010166064 0.025937658 [36] -0.106989231 0.070931960 -0.089443704 -0.038089901 -0.001010096 [41] -0.030793691 -0.004490745 -0.141509706 -0.005039349 -0.009783419 [46] 0.017567884 0.041287666 -0.110202805 -0.027498671 -0.020931471 [51] 0.063956475 0.019705969 -0.063586568 0.038944945 0.018705669 [56] 0.006700658 0.006311263 0.010084881 -0.001593571 0.081423013 > 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/3kipc1281709170.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/45jni1281709170.tab") > > try(system("convert tmp/1o8931281709170.ps tmp/1o8931281709170.png",intern=TRUE)) character(0) > try(system("convert tmp/2o8931281709170.ps tmp/2o8931281709170.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.89 0.21 1.06