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(100.34,115.78,114.6,114.2,115.88,125.22,161.71,165.01,135.78,153.67,125.52,135.29,103.05,120.79,120.17,119.62,121.17,129.86,167.8,167.14,140.55,158.44,131.07,140.55,106.15,123.65,122.8,122.25,123.88,132.96,171.82,173.69,149.5,164.44,133.37,143.77,69.49,84.5,82.3,78.8,79.47,88.93,138.13,139.69,114.43,128.65,95.92,98.22,56.65,69.6,66.91,63.76,64,35.24,45.3,43.02,43.08,43.17,46.38,70.85,72.81,59.51,67.54,56.51,53.82,112.55,127.65,126.51,126.08,127.34) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '1' > par1 = '48' > #'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/1ttla1260292944.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/23t3b1260292944.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.8374060669 0.7492170789 0.6073721472 0.5005318626 [6] 0.3918075161 0.2824578400 0.3074610370 0.3178119617 0.3149575281 [11] 0.3430611465 0.3213533894 0.3873085724 0.2766681876 0.2334260030 [16] 0.1409047855 0.0796861004 -0.0002873869 -0.1107335812 -0.1164305375 [21] -0.1074010870 -0.1026784911 -0.0621098491 -0.0445380623 0.0214363410 [26] -0.0571626742 -0.0998387272 -0.1785212933 -0.2375719807 -0.3078108492 [31] -0.3652435363 -0.3486591919 -0.3191618074 -0.2907095544 -0.2373530242 [36] -0.2048300334 -0.1461969614 -0.1696665686 -0.1746462587 -0.1965202867 [41] -0.2102481514 -0.2224442579 -0.2442432450 -0.2396199606 -0.2258843893 [46] -0.2175603978 -0.1926948736 -0.1704294401 -0.1444834408 > (mypacf <- c(rpacf$acf)) [1] 0.837406067 0.160562292 -0.184662962 -0.026117295 -0.026872703 [6] -0.093442839 0.391926011 0.133294880 -0.196609612 0.137698621 [11] -0.120472660 0.238333149 -0.325320727 -0.028921287 -0.086423212 [16] 0.013096555 -0.110340193 -0.110481522 0.043576785 0.121542859 [21] -0.015894124 0.026893301 0.053388360 -0.157537976 -0.131558848 [26] -0.043255592 -0.022969415 -0.040937751 -0.051216969 0.079685656 [31] -0.007476879 -0.021444232 0.020536948 0.021511432 -0.017870215 [36] -0.066709728 0.027582402 -0.011786100 0.040198421 -0.030418508 [41] 0.141395776 -0.063652503 -0.155634198 -0.052338664 0.005125313 [46] -0.062364434 -0.005418687 -0.101207032 > 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/3gv7w1260292944.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/4kddw1260292944.tab") > > system("convert tmp/1ttla1260292944.ps tmp/1ttla1260292944.png") > system("convert tmp/23t3b1260292944.ps tmp/23t3b1260292944.png") > > > proc.time() user system elapsed 0.581 0.310 0.695