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(94.20,95.20,95.00,94.00,92.20,91.00,91.20,103.40,105.00,104.60,103.80,101.80,102.40,103.80,103.40,102.00,101.80,100.20,101.40,113.80,116.00,115.60,113.00,109.40,111.00,112.40,112.20,111.00,108.80,107.40,108.60,118.80,122.20,122.60,122.20,118.80,119.00,118.20,117.80,116.80,114.60,113.40,113.80,124.20,125.80,125.60,122.40,119.00,119.40,118.60,118.00,116.00,114.80,114.60,114.60,124.00,125.20,124.00,117.60,113.20,111.40,112.20,109.80,106.40,105.20,102.20,99.80,111.00,113.00,108.40,105.40,102.00,102.80) > 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/rcomp/tmp/1uegw1228331178.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/22os81228331178.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.005183991 0.021783508 0.017767929 -0.032044050 [6] -0.048079506 -0.018049960 -0.036368520 0.007762557 0.129653505 [11] -0.187147462 0.030029546 -0.254069299 -0.093432716 0.118640881 [16] 0.001141553 0.022978781 -0.085320978 0.141995702 0.080969648 [21] 0.089578297 -0.002605426 0.008353478 0.114799893 -0.142774644 [26] -0.083333333 -0.209427881 0.067982810 -0.075302176 0.101047542 [31] -0.122817620 -0.089497717 0.054955681 -0.079264034 0.004082729 [36] 0.001208703 0.020024174 0.090478109 0.151598174 -0.119809294 [41] -0.012892828 -0.006298684 -0.118694601 0.074711254 -0.075557346 [46] -0.065135643 0.026873489 -0.024281493 -0.026148268 -0.083279613 [51] -0.046736503 0.031305399 0.068251410 -0.039376847 0.103464948 [56] 0.017660489 0.028820843 0.018963202 0.009239860 0.016438356 > (mypacf <- c(rpacf$acf)) [1] 0.005183991 0.021757219 0.017553452 -0.032716818 -0.048615836 [6] -0.016573751 -0.033048646 0.009520711 0.129408567 -0.194530279 [11] 0.026713584 -0.269778053 -0.072731316 0.141084826 -0.004520927 [16] 0.025815405 -0.166292819 0.139595253 0.137083699 0.061296563 [21] 0.094169624 -0.135235909 0.113453492 -0.205594771 -0.110190654 [26] -0.128744672 0.015824076 -0.014198532 0.022196044 -0.095232206 [31] -0.004196739 0.068416787 0.021511021 -0.065091797 0.078753808 [36] -0.144284036 0.055061196 -0.016559774 -0.094298211 0.009778352 [41] -0.129790504 -0.100341455 0.011306547 0.034257216 0.034739479 [46] -0.062721809 0.029006231 -0.022994224 -0.064780856 -0.054646409 [51] -0.022867494 -0.060690788 0.013996092 0.003859429 -0.008201224 [56] -0.037645195 -0.008580362 0.023706602 0.027377178 > 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/3c4311228331178.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/44rfc1228331178.tab") > > system("convert tmp/1uegw1228331178.ps tmp/1uegw1228331178.png") > system("convert tmp/22os81228331178.ps tmp/22os81228331178.png") > > > proc.time() user system elapsed 0.617 0.328 0.750