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(97.8,107.4,117.5,105.6,97.4,99.5,98,104.3,100.6,101.1,103.9,96.9,95.5,108.4,117,103.8,100.8,110.6,104,112.6,107.3,98.9,109.8,104.9,102.2,123.9,124.9,112.7,121.9,100.6,104.3,120.4,107.5,102.9,125.6,107.5,108.8,128.4,121.1,119.5,128.7,108.7,105.5,119.8,111.3,110.6,120.1,97.5,107.7,127.3,117.2,119.8,116.2,111,112.4,130.6,109.1,118.8,123.9,101.6,112.8,128,129.6,125.8,119.5,115.7,113.6,129.7,112,116.8,127,112.1,114.2,121.1,131.6,125,120.4,117.7,117.5,120.6,127.5,112.3,124.5,115.2,105.4) > 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/1i5mt1228762955.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/2finy1228762955.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.0000000000 0.0494469396 0.0753379064 0.2559435662 -0.0790863810 [6] 0.0695569835 0.2024065479 -0.1235612655 0.0982886440 0.2458969036 [11] -0.1422193486 -0.0617720241 -0.1232481790 -0.2179663953 0.0675230540 [16] -0.0442162977 -0.1151366295 0.1748722012 -0.0030307630 -0.2138243697 [21] -0.0089306023 -0.0059406978 -0.1568682163 0.1479185563 -0.2472782213 [26] -0.0965183315 0.0466569674 -0.0018786457 -0.1022460177 0.0396623147 [31] -0.0210618900 0.0707439038 0.1427287301 -0.1305169020 0.0590943366 [36] 0.1523104045 0.0496510111 0.1919123742 0.0979218364 -0.0535972113 [41] 0.0580393154 -0.0304472233 -0.1328188637 0.0342519757 0.0420376845 [46] -0.1182250250 0.1024321081 -0.0752504193 -0.1372657201 -0.0147652612 [51] -0.1081751258 -0.1618325528 0.1134327052 -0.0451641657 -0.0521226932 [56] 0.0652682299 -0.1645959583 -0.0601906125 -0.0061340783 -0.1112048134 [61] 0.0005683841 > (mypacf <- c(rpacf$acf)) [1] 0.0494469396 0.0730715665 0.2508266542 -0.1109565499 0.0465883190 [6] 0.1579718199 -0.1142278422 0.0581643346 0.2068676751 -0.1202883877 [11] -0.1813801869 -0.2105115172 -0.0805391271 0.0934755454 -0.0169772786 [16] 0.0068098778 0.1751747879 0.0307253601 -0.2252624814 -0.0720644572 [21] 0.2359369050 -0.1060489601 -0.0748466836 -0.3365880505 0.0120413118 [26] -0.0691248051 0.2091168925 0.0736427641 0.1489892763 0.0007671295 [31] -0.0207058577 0.0532524296 0.0145943095 0.0283372540 0.0119499890 [36] -0.0084236515 0.0465952887 -0.0752916880 -0.0763200318 -0.0500825307 [41] 0.0263704387 0.0041171599 -0.0255747404 -0.0324765299 -0.0727387623 [46] 0.0384249822 0.0888865939 -0.1516543283 0.0300375020 -0.0358785280 [51] -0.0402527169 -0.0687645847 -0.0305794704 0.0322242600 0.0324817060 [56] -0.0096775461 -0.0226318962 -0.0700320378 0.0398465405 0.0393474381 > 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/3qhxs1228762955.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/499ik1228762955.tab") > > system("convert tmp/1i5mt1228762955.ps tmp/1i5mt1228762955.png") > system("convert tmp/2finy1228762955.ps tmp/2finy1228762955.png") > > > proc.time() user system elapsed 0.590 0.309 0.787