R version 2.9.0 (2009-04-17) Copyright (C) 2009 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(13.4,14,14.7,16.1,16.3,16.1,16.5,19,18.7,17.7,17.2,16.6,17.4,15.5,12.4,11.1,11.1,13.7,12.1,11.3,9.9,10.9,13.2,14.2,16.8,17,19.6,18.3,20.6,17.7,19.6,17.4,17.6,19,17.8,17,15.7,16,17.1,17,15.7,15.6,16.1,17.4,16,15,14.3,14.5,14.3,16.2,14.8,16.3,14,15.4,13.4,12.9,14.3,11.9,8.6,5.5,0.8) > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '0' > par3 = '1' > par2 = '1' > par1 = '36' > #'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: > 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 (par6 == 'White Noise') par6 <- 'white' else par6 <- 'ma' > par7 <- as.numeric(par7) > 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/10bct1259338826.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > racf <- acf(x, par1, main='Autocorrelation', xlab='time lag', ylab='ACF', ci.type=par6, ci=par7, sub=paste('(lambda=',par2,', d=',par3,', D=',par4,', CI=', par7, ', CI type=',par6,')',sep='')) > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/230x91259338826.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.044715136 0.284017665 -0.145408592 0.107325085 [6] 0.158932199 0.036767765 -0.109339149 -0.122630996 -0.049338175 [11] -0.048633162 -0.081141039 -0.184071195 -0.006467998 -0.001571834 [16] 0.063429931 0.084877794 -0.027328856 0.021875494 0.040482621 [21] -0.018090685 0.213906225 -0.135596190 0.195285108 -0.127738239 [26] 0.144515615 0.059828218 0.010987627 -0.086407046 -0.026654866 [31] -0.021430223 0.047361218 -0.040033091 -0.152209326 -0.105851795 [36] -0.140294050 -0.103997713 > (mypacf <- c(rpacf$acf)) [1] 0.0447151356 0.2825832307 -0.1820256880 0.0514611702 0.2703043821 [6] -0.0828051263 -0.2476006955 -0.0057009339 0.0524650447 -0.1481455831 [11] -0.1039798325 -0.0411621986 0.1082056246 0.0299019631 -0.0327867512 [16] 0.1787896405 0.0099950319 -0.1583613938 0.0455450177 -0.0256803549 [21] 0.1757916408 -0.2021968994 0.1354292743 0.0775488274 -0.0032701705 [26] 0.1016367549 -0.0296870799 -0.1308164765 0.0355732930 0.0009219867 [31] -0.0423382234 -0.0335518837 -0.0332384602 -0.1077328486 -0.0868776635 [36] -0.1542397043 > 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/3x02t1259338826.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/4guy11259338826.tab") > > system("convert tmp/10bct1259338826.ps tmp/10bct1259338826.png") > system("convert tmp/230x91259338826.ps tmp/230x91259338826.png") > > > proc.time() user system elapsed 0.563 0.314 1.215