R version 2.8.0 (2008-10-20) Copyright (C) 2008 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(98.6,98,106.8,96.7,100.2,107.7,92,98.4,107.4,117.7,105.7,97.5,99.9,98.2,104.5,100.8,101.5,103.9,99.6,98.4,112.7,118.4,108.1,105.4,114.6,106.9,115.9,109.8,101.8,114.2,110.8,108.4,127.5,128.6,116.6,127.4,105,108.3,125,111.6,106.5,130.3,115,116.1,134,126.5,125.8,136.4,114.9,110.9,125.5,116.8,116.8,125.5,104.2,115.1,132.8,123.3,124.8,122,117.4,117.9,137.4,114.6,124.7,129.6,109.4,120.9,134.9,136.3,133.2,127.2,122.7,120.5,137.8,119.1,124.3,134.4,121.1,122.2,127.7,137.4,132.2,129.2,124.9,124.8,128.2,134.4,118.6,132.6,123.2,112.8,138.3) > par5 = '12' > par4 = '0' > par3 = '0' > 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: Write here your technical program description (don't use hard returns!) > 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 (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/1nbi11229781861.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > racf <- acf(x,par1,main='Autocorrelation',xlab='lags',ylab='ACF') > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/2ielj1229781861.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.00000000 0.56245912 0.48405462 0.65529257 0.42298932 0.48210260 [7] 0.62316845 0.38783254 0.37111661 0.51986889 0.33702955 0.42896073 [13] 0.62658835 0.35059217 0.27974470 0.38845871 0.17738224 0.23563979 [19] 0.34120032 0.12070967 0.11969072 0.21389428 0.08284598 0.16983292 [25] 0.27182074 0.10287112 0.03648590 0.11807057 -0.04481349 -0.01896969 [31] 0.08884212 -0.06797244 -0.07384676 -0.01587610 -0.08391248 -0.01824191 [37] 0.12102960 -0.03859519 -0.09848284 -0.02573439 -0.13646385 -0.13628488 [43] -0.04981086 -0.14428265 -0.16499702 -0.11690293 -0.17936849 -0.14178059 [49] -0.01654890 -0.14823593 -0.20181580 -0.15103588 -0.22014355 -0.20564113 [55] -0.15743578 -0.23873111 -0.26816187 -0.20882591 -0.28465735 -0.24020805 [61] -0.16239037 > (mypacf <- c(rpacf$acf)) [1] 0.562459123 0.245296378 0.485361373 -0.140815178 0.245295396 [6] 0.216002640 -0.105916719 -0.094533578 0.154689457 -0.061241871 [11] 0.190992461 0.292632916 -0.139546075 -0.303274183 -0.136314287 [16] -0.182863528 -0.034680248 -0.005291826 0.056957092 -0.029818710 [21] -0.002610847 0.022956556 0.035882207 -0.034754358 0.104815232 [26] -0.126268441 0.051119066 -0.137057337 -0.022750327 -0.025452259 [31] 0.124769890 0.001940870 -0.018912886 0.008171917 0.026815043 [36] 0.146869223 -0.036354485 -0.081511167 -0.061053792 -0.029738819 [41] -0.074206969 -0.089133914 0.085206714 0.046913288 -0.044824972 [46] -0.061472565 -0.111292332 -0.036643134 -0.090992914 0.037356198 [51] -0.019755728 0.094708665 0.060495437 -0.055863322 -0.082507104 [56] -0.067405748 -0.017770142 -0.087543714 -0.001579834 0.005667671 > 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/37lga1229781861.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/4kazt1229781861.tab") > > system("convert tmp/1nbi11229781861.ps tmp/1nbi11229781861.png") > system("convert tmp/2ielj1229781861.ps tmp/2ielj1229781861.png") > > > proc.time() user system elapsed 0.594 0.334 0.703