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(182,213,227,209,219,221,114,97,205,215,224,189,182,201,198,173,238,258,122,101,259,243,188,173,224,215,196,159,187,208,131,93,210,228,176,195,188,188,190,188,176,225,93,79,235,247,195,197,211,156,209,180,185,303,129,85,249,231,212,240,234,217,287,221,208,241,156,96,320,242,227,200) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '1' > 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/10suv1292321652.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/20suv1292321652.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.000000000 0.277148242 0.055498393 -0.083020544 0.081770102 [6] 0.097971372 0.222826274 0.143490632 0.157260095 0.160072982 [11] 0.010214393 -0.127442353 -0.249065969 0.013463443 0.232352049 [16] 0.171282124 -0.053540435 -0.104917709 -0.021441390 -0.102128768 [21] -0.007909363 -0.091718411 -0.003529952 0.047659480 -0.085513434 [26] -0.198464100 -0.225194565 -0.041082278 0.023880258 0.066619560 [31] -0.201749957 -0.183801803 -0.163832907 -0.023232454 -0.076225444 [36] -0.035270345 -0.004387131 0.059108418 0.002817588 -0.086464808 [41] -0.135006895 -0.054321309 0.147736186 0.144016508 0.033729250 [46] -0.046518526 -0.051214001 -0.081894299 -0.049588003 > (mypacf <- c(rpacf$acf)) [1] 0.277148242 -0.023086019 -0.100096442 0.145126474 0.046701974 [6] 0.181178206 0.060847104 0.111547161 0.140220220 -0.100710826 [11] -0.142299291 -0.267730637 0.057544741 0.178939126 -0.011918853 [16] -0.062965151 -0.004045538 0.127104337 -0.137275461 0.024267374 [21] -0.097266486 -0.045463112 0.012184797 -0.255261143 -0.005540162 [26] -0.038426013 0.110635993 -0.009745947 0.028551871 -0.092076596 [31] -0.121787241 -0.035628555 -0.010165066 -0.004997279 0.017517098 [36] 0.014293185 0.079237300 0.023791964 0.128256518 -0.075355793 [41] -0.032380485 0.075051953 -0.080661836 0.019371263 -0.047348348 [46] -0.005547418 -0.130315798 -0.004699999 > 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/3az3x1292321652.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/4vzjl1292321652.tab") > > try(system("convert tmp/10suv1292321652.ps tmp/10suv1292321652.png",intern=TRUE)) character(0) > try(system("convert tmp/20suv1292321652.ps tmp/20suv1292321652.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.590 0.355 1.399