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(11.1,10.9,10,9.2,9.2,9.5,9.6,9.5,9.1,8.9,9,10.1,10.3,10.2,9.6,9.2,9.3,9.4,9.4,9.2,9,9,9,9.8,10,9.8,9.3,9,9,9.1,9.1,9.1,9.2,8.8,8.3,8.4,8.1,7.7,7.9,7.9,8,7.9,7.6,7.1,6.8,6.5,6.9,8.2,8.7,8.3,7.9,7.5,7.8,8.3,8.4,8.2,7.7,7.2,7.3,8.1) > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '0' > 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: > 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/101wm1259918104.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/2mnhx1259918104.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.00000000 0.39693422 -0.24806551 -0.49902866 -0.33453852 0.10023977 [7] 0.39032812 0.23283814 -0.14038003 -0.32782283 -0.25546520 0.07112656 [13] 0.35967059 0.05392687 -0.12754233 -0.09620225 -0.05339015 0.07654818 [19] 0.10785432 0.01600600 -0.15195474 -0.19827137 -0.11544298 0.12056058 [25] 0.25097407 0.01292543 -0.13843821 -0.08707301 -0.04578825 0.09662334 [31] 0.15744108 0.07957639 -0.15548545 -0.22827597 -0.04922520 0.18331639 [37] 0.29370477 0.08014447 -0.13640262 -0.16970294 -0.03628567 0.18225531 [43] 0.25261043 0.07716573 -0.23146296 -0.31827106 -0.11425678 0.10966383 [49] 0.20796926 0.04294441 -0.09295917 -0.11719727 -0.02983777 0.05998244 [55] 0.10476311 0.03791225 -0.06993920 -0.07459341 -0.01270654 > (mypacf <- c(rpacf$acf)) [1] 0.3969342186 -0.4814832326 -0.2503870760 -0.1397567662 0.1082681538 [6] 0.1083658937 -0.0823473375 -0.1168123154 -0.0440541653 -0.0996810470 [11] 0.0624500320 0.1165262060 -0.3991540284 0.2243901967 0.1134910699 [16] -0.1181399965 0.0261108344 -0.0858227899 0.0743922132 -0.1508191783 [21] -0.1909464347 -0.0312138348 0.0673815467 -0.0282378824 -0.0645874331 [26] -0.1093140947 0.1225493227 -0.0077890364 -0.0553682989 -0.0032458966 [31] -0.0258253050 -0.1370678380 -0.0191083397 0.0883224202 -0.0287383103 [36] 0.1509387891 0.0330172877 -0.0247177227 0.0110379761 0.1901022936 [41] 0.0814674520 -0.0111818423 -0.0694450899 0.0404975247 0.0173021546 [46] -0.1315362817 -0.0403283697 -0.0436967757 0.0116923843 0.0918261216 [51] -0.0953929901 0.0002976820 -0.0309134100 0.0039018369 0.0159563842 [56] 0.0215104680 -0.0219645337 -0.0058973997 > 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/3rrpf1259918104.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/4l08h1259918104.tab") > > system("convert tmp/101wm1259918104.ps tmp/101wm1259918104.png") > system("convert tmp/2mnhx1259918104.ps tmp/2mnhx1259918104.png") > > > proc.time() user system elapsed 0.598 0.324 2.155