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(127.84,132.43,134.13,134.78,133.13,129.08,134.48,132.86,134.08,134.54,134.51,135.97,136.09,139.14,135.63,136.55,138.83,138.84,135.37,132.22,134.75,135.98,136.06,138.05,139.59,140.58,139.81,140.77,140.96,143.59,142.7,145.11,146.7,148.53,148.99,149.65,151.11,154.82,156.56,157.6,155.24,160.68,163.22,164.55,166.76,159.05,159.82,164.95,162.89,163.55,158.68,157.97,156.59,161.56,162.31,166.26,168.45,163.63,153.2,133.52,123.28) > par5 = '12' > par4 = '0' > 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/1xznz1229784388.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/2gdyg1229784388.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.899428262 0.786732698 0.708086318 0.663376568 [6] 0.642665218 0.608494077 0.583228232 0.549968982 0.503015201 [11] 0.446609027 0.383960123 0.338961306 0.292212348 0.259390103 [16] 0.187950270 0.112529704 0.070018311 0.034343785 -0.001630218 [21] -0.047504055 -0.100341458 -0.138540960 -0.170156151 -0.194625342 [26] -0.221552498 -0.244582355 -0.270282691 -0.288972413 -0.304922013 [31] -0.313261325 -0.326135368 -0.337890569 -0.351995307 -0.363733368 [36] -0.370785348 -0.371286971 -0.367548200 -0.350696989 -0.334026439 [41] -0.306847017 -0.302752343 -0.308511536 -0.299781781 -0.277568293 [46] -0.243728940 -0.237522770 -0.230574822 -0.202629745 -0.180257206 [51] -0.152267168 -0.135078221 -0.113759980 -0.096874654 -0.070245355 [56] -0.044671274 -0.032007033 -0.001296490 0.033480268 0.057835304 [61] 0.044558559 > (mypacf <- c(rpacf$acf)) [1] 0.8994282623 -0.1164143865 0.1210313786 0.1116265887 0.1071169510 [6] -0.0524731391 0.0994473846 -0.0469271339 -0.0618063587 -0.0754199000 [11] -0.0705355572 0.0071391556 -0.0863136975 0.0439488882 -0.2650521656 [16] -0.0128403567 0.0561898255 -0.0403604444 -0.0646998314 -0.0140330808 [21] -0.0830355206 0.0177394290 0.0160249373 0.0002472965 -0.0221874674 [26] -0.0150479201 -0.0310992351 0.0037906871 0.0152326380 0.0435710954 [31] -0.1199320800 -0.0036896925 -0.0317206517 -0.0261874909 -0.0064526573 [36] -0.0144212298 -0.0434019514 0.0580826061 0.0074975217 0.0780319116 [41] -0.1147512433 -0.0372168986 0.0463553961 0.0038630338 0.0655647722 [46] -0.1475114925 0.0247849197 0.0611761470 -0.0464013287 0.0318631975 [51] 0.0083487475 -0.0418074170 -0.0322413229 0.0698030406 -0.0022053484 [56] -0.0050544291 0.0554322410 0.0124917052 -0.0700421691 -0.1334418939 > 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/3bdna1229784388.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/4fnl91229784388.tab") > > system("convert tmp/1xznz1229784388.ps tmp/1xznz1229784388.png") > system("convert tmp/2gdyg1229784388.ps tmp/2gdyg1229784388.png") > > > proc.time() user system elapsed 0.602 0.336 1.235