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.8,100.5,110.4,96.4,101.9,106.2,81.0,94.7,101.0,109.4,102.3,90.7,96.2,96.1,106.0,103.1,102.0,104.7,86.0,92.1,106.9,112.6,101.7,92.0,97.4,97.0,105.4,102.7,98.1,104.5,87.4,89.9,109.8,111.7,98.6,96.9,95.1,97.0,112.7,102.9,97.4,111.4,87.4,96.8,114.1,110.3,103.9,101.6,94.6,95.9,104.7,102.8,98.1,113.9,80.9,95.7,113.2,105.9,108.8,102.3,99.0,100.7,115.5,100.7,109.9,114.6,85.4,100.5,114.8,116.5,112.9,102.0,106.0,105.3,118.8,106.1,109.3,117.2,92.5,104.2,112.5,122.4,113.3,100.0) > 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/10y9u1230038167.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/2lpso1230038167.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.144372835 -0.180223431 -0.006711103 -0.064709084 [6] 0.291659545 0.398576477 0.235629462 -0.037412144 -0.048219086 [11] -0.234250338 0.111335761 0.727757130 0.062459118 -0.200570605 [16] -0.103028540 -0.127793608 0.197963080 0.269010777 0.123812377 [21] -0.066261506 -0.101492855 -0.259221176 0.077972214 0.500618183 [26] 0.004649495 -0.165327712 -0.155515634 -0.145800621 0.111501319 [31] 0.158926635 0.088894666 -0.067914476 -0.156086026 -0.228819102 [36] 0.011109391 0.375126039 0.012642496 -0.160912107 -0.136364258 [41] -0.156335685 0.040759746 0.084288706 0.073937064 -0.045927457 [46] -0.173927126 -0.206102517 -0.036855844 0.252228908 -0.008424311 [51] -0.177907164 -0.148640166 -0.137014333 0.003151087 0.017624075 [56] 0.020583161 -0.089622974 -0.130029450 -0.168649710 -0.056883156 [61] 0.171942492 > (mypacf <- c(rpacf$acf)) [1] 0.1443728352 -0.2053471017 0.0578949396 -0.1183706926 0.3624085260 [6] 0.2838657647 0.3601680546 0.0319506511 0.1572948727 -0.4896626315 [11] 0.0225407607 0.4671105311 -0.1372901906 -0.1337063900 -0.0916614634 [16] 0.0171785827 -0.0895166061 -0.0810152205 0.0040644057 0.0223711101 [21] 0.0604800875 0.0330430755 0.0556894335 -0.0790963382 -0.0062676094 [26] 0.0278015722 -0.0371287362 -0.0479419143 -0.1040635007 -0.0433031406 [31] 0.0606646070 0.0043039360 -0.0629238347 0.0870973998 -0.0962556139 [36] 0.1689900605 -0.0164748402 -0.0079974585 -0.0014080232 -0.0355271102 [41] -0.0742050716 -0.1095049720 -0.0558813187 -0.0006179848 -0.0248123410 [46] 0.0381106266 0.0170421388 -0.0266597001 -0.0778851227 -0.0263845240 [51] -0.0933323022 0.0715727017 0.0223609552 0.0079023245 -0.1071657141 [56] -0.0767997438 0.0990882374 0.0105498841 0.0159712859 -0.0723598896 > 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/3y3na1230038167.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/4peya1230038167.tab") > > system("convert tmp/10y9u1230038167.ps tmp/10y9u1230038167.png") > system("convert tmp/2lpso1230038167.ps tmp/2lpso1230038167.png") > > > proc.time() user system elapsed 0.597 0.324 0.756