R version 2.7.0 (2008-04-22) 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 = '1' > 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/1gtez1229683809.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/2qa2x1229683809.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.111028854 0.161894434 0.250251634 0.042639429 [6] 0.189579300 0.187337306 -0.091896319 0.087679755 0.214772527 [11] -0.140284142 -0.056269923 -0.139942132 -0.202908242 0.061597261 [16] -0.049144979 -0.145919365 0.135891608 -0.075620621 -0.172498392 [21] -0.004176512 -0.036953845 -0.075649650 0.168938439 -0.247334962 [26] -0.075599517 0.014031367 -0.021590969 -0.098393276 -0.030400515 [31] -0.059369837 0.034965195 0.095708943 -0.161285135 -0.023289426 [36] 0.059380169 0.029484143 0.167162500 0.056037916 -0.058483228 [41] 0.101730329 0.012509370 -0.032549116 0.068668753 0.067281168 [46] -0.062303120 0.129069108 -0.079685855 -0.122115810 -0.021576669 [51] -0.113434921 -0.119876869 0.061045290 -0.101964824 -0.046375171 [56] -0.015956445 -0.218451486 -0.060272965 -0.040595371 -0.093823001 [61] -0.006856014 > (mypacf <- c(rpacf$acf)) [1] 0.1110288541 0.1514338135 0.2260932157 -0.0202475451 0.1300638537 [6] 0.1198366117 -0.1718967614 0.0002549113 0.2070710709 -0.1831629328 [11] -0.1843651792 -0.1521356917 -0.0893120400 0.0791289890 0.0556119182 [16] 0.0210940237 0.1966072017 -0.0484525944 -0.1929861025 -0.0411717647 [21] 0.1690158084 -0.0724011070 0.0336255601 -0.2770471307 -0.0932549166 [26] -0.0968746474 0.2593460547 0.0193510751 0.0443747627 -0.0116451488 [31] -0.0564070925 -0.0341959406 0.0450958141 0.0132185990 0.0792418601 [36] -0.0437034921 0.0610915604 -0.0586570011 -0.0304479200 -0.0500940882 [41] 0.0736987067 0.0288735185 0.0172434715 -0.0481053276 -0.0818453110 [46] -0.0018561379 0.0336872474 -0.1437917810 0.0001643633 -0.0568718121 [51] -0.0172297487 -0.0070438089 -0.0257178333 0.0143213890 0.0334896542 [56] -0.0533571859 -0.0542862913 -0.1084632606 0.0259455964 -0.0330555856 > 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/3jn0d1229683809.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/4lezd1229683809.tab") > > system("convert tmp/1gtez1229683809.ps tmp/1gtez1229683809.png") > system("convert tmp/2qa2x1229683809.ps tmp/2qa2x1229683809.png") > > > proc.time() user system elapsed 1.554 0.559 1.645