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(376,375,374,372,370,369,370,372,373,373,374,376,371,374,369,363,357,366,362,366,361,362,358,363,360,360,348,345,332,333,323,327,332,337,336,337,343,337,326,321,309,302,293,287,292,292,289,302,310,295,276,264,257,243,227,226,226,229,224,240,244,226,208,199,193,180,167,164,166,173,169,191,193,166,143,147,139,129,115,108,106,116,108,135) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '2' > 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/10v2e1282043858.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/20v2e1282043858.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.303350664 -0.134915854 -0.111396845 0.362866682 [6] -0.213610247 -0.047104636 -0.214576270 0.296270951 -0.081371620 [11] -0.147814180 -0.154829813 0.570135587 -0.168899155 -0.145504528 [16] 0.002968155 0.264479173 -0.152876964 -0.128043054 -0.025485293 [21] 0.122505090 -0.046903358 -0.145571146 0.008526673 0.305641556 [26] -0.096405376 -0.108454693 0.020962078 0.202990121 -0.160830759 [31] -0.015231566 -0.020868838 0.021655314 -0.022969534 -0.056564952 [36] -0.017564126 0.155833293 -0.078789677 -0.009485205 0.031185901 [41] 0.110735432 -0.162854808 0.103184750 -0.094001617 0.048975389 [46] -0.088517518 0.057670588 -0.044731214 0.086167994 > (mypacf <- c(rpacf$acf)) [1] -0.303350664 -0.249937097 -0.280022383 0.229241133 -0.079166041 [6] -0.054314780 -0.305216294 -0.019707114 -0.019017715 -0.202434806 [11] -0.243920966 0.354413674 0.106830251 -0.029261805 0.108627739 [16] 0.010568034 -0.015026052 -0.116738044 0.092032586 -0.105088586 [21] -0.076303264 -0.001099980 0.051028404 0.047656457 -0.011062397 [26] 0.107338095 -0.084024839 -0.001904253 -0.079505520 0.151710724 [31] -0.004765986 -0.120958060 0.086853918 0.016812841 -0.051508126 [36] -0.071129587 0.006753701 -0.006406253 -0.005176065 0.024619613 [41] -0.018296156 0.048309268 -0.138379914 0.107957625 -0.088331646 [46] -0.002457547 0.014416220 0.021731383 > 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/33v0k1282043858.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/47ehq1282043858.tab") > > try(system("convert tmp/10v2e1282043858.ps tmp/10v2e1282043858.png",intern=TRUE)) character(0) > try(system("convert tmp/20v2e1282043858.ps tmp/20v2e1282043858.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.563 0.317 0.725