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(7.6,7.4,7.3,7.1,6.9,6.8,7.5,7.6,7.8,8,8.1,8.2,8.3,8.2,8,7.9,7.6,7.6,8.2,8.3,8.4,8.4,8.4,8.6,8.9,8.8,8.3,7.5,7.2,7.5,8.8,9.3,9.3,8.7,8.2,8.3,8.5,8.6,8.6,8.2,8.1,8,8.6,8.7,8.8,8.5,8.4,8.5,8.7,8.7,8.6,8.5,8.3,8.1,8.2,8.1,8.1,7.9,7.9,7.9,8,8,7.9,8,7.7,7.2,7.5,7.3,7,7,7,7.2,7.3,7.1,6.8,6.6,6.2,6.2,6.8,6.9,6.8,6.7) > par5 = '12' > par4 = '1' > par3 = '1' > 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/freestat/rcomp/tmp/1y8je1229173558.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/freestat/rcomp/tmp/2qx6c1229173558.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.4656458876 -0.0980275672 -0.5463876277 -0.6011951378 [6] -0.2041200375 0.1661608313 0.3121557453 0.2974694405 0.1010873835 [11] -0.0825849490 -0.1434807819 -0.2292629848 -0.0595039723 0.0776530538 [16] 0.1553577484 0.0986143200 -0.0756589889 -0.1064218326 -0.0907226371 [21] 0.0895576705 0.1492779647 0.0657403048 -0.0518302377 -0.2009366087 [26] -0.0953434679 0.0409437978 0.0809962843 -0.0033830792 -0.0930090619 [31] -0.1411390568 0.0817314534 0.1959099711 0.1875645001 0.0663746321 [36] -0.1408092879 -0.2019856886 -0.1716127936 0.0006432730 0.1034868487 [41] 0.1734478701 0.1515790278 0.0381608898 -0.0940833522 -0.1920422007 [46] -0.1483984454 -0.0090529899 0.1192380915 0.1518555295 0.0992925623 [51] -0.0417895676 -0.0861038394 -0.0645968890 -0.0181755119 0.0509157491 [56] 0.0144012641 0.0005566629 -0.0232761544 -0.0219420339 -0.0170166446 [61] 0.0006465260 > (mypacf <- c(rpacf$acf)) [1] 0.465645888 -0.402022663 -0.449577356 -0.275893306 0.055066626 [6] -0.118609681 -0.199526764 0.056074054 0.040875150 -0.032763615 [11] 0.035511638 -0.156036198 0.155999625 0.034511176 -0.007566374 [16] -0.120533437 -0.079342075 0.117600799 -0.114270815 0.146826489 [21] -0.022122246 -0.042137252 0.054740396 -0.195901258 0.215213658 [26] -0.078247260 -0.118440494 -0.257460780 -0.148921963 -0.036713401 [31] 0.023989301 0.069561765 -0.065386265 0.078317257 0.132759327 [36] -0.118021565 0.073654064 0.120031768 -0.035586968 -0.061049201 [41] -0.022951433 0.048352007 -0.027153179 0.010571875 -0.009904344 [46] -0.032548158 0.022923784 -0.058593734 0.025580986 0.056717742 [51] -0.025601594 -0.102969321 -0.082684175 -0.018062343 0.038768549 [56] -0.020814063 -0.035927205 -0.018540204 0.012553539 0.025002727 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/html/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/3nf081229173558.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/freestat/rcomp/tmp/4t48m1229173558.tab") > > system("convert tmp/1y8je1229173558.ps tmp/1y8je1229173558.png") > system("convert tmp/2qx6c1229173558.ps tmp/2qx6c1229173558.png") > > > proc.time() user system elapsed 0.822 0.426 0.949