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(98.6,98,106.8,96.7,100.2,107.7,92,98.4,107.4,117.7,105.7,97.5,99.9,98.2,104.5,100.8,101.5,103.9,99.6,98.4,112.7,118.4,108.1,105.4,114.6,106.9,115.9,109.8,101.8,114.2,110.8,108.4,127.5,128.6,116.6,127.4,105,108.3,125,111.6,106.5,130.3,115,116.1,134,126.5,125.8,136.4,114.9,110.9,125.5,116.8,116.8,125.5,104.2,115.1,132.8,123.3,124.8,122,117.4,117.9,137.4,114.6,124.7,129.6,109.4,120.9,134.9,136.3,133.2,127.2,122.7,120.5,137.8,119.1,124.3,134.4,121.1,122.2,127.7,137.4,132.2,129.2,124.9,124.8,128.2,134.4,118.6,132.6,123.2,112.8,138.3) > par5 = '12' > par4 = '1' > par3 = '1' > par2 = '-0.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/19kxf1229680043.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/201d11229680043.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.501361146 -0.056398397 0.183165379 -0.194245619 [6] 0.065822021 0.176642511 -0.280590147 0.044529472 0.270239051 [11] -0.258354205 0.114589343 -0.004372884 -0.204614343 0.210623598 [16] -0.009874285 -0.222253167 0.302727897 -0.069206159 -0.152063896 [21] 0.118240507 -0.011264137 -0.148369979 0.361559838 -0.327862908 [26] 0.030255346 0.105180653 -0.001955483 -0.072387446 0.067323893 [31] -0.095938589 0.024538869 0.179325510 -0.202374664 0.024354527 [36] 0.069117534 -0.114586882 0.157021780 0.003314304 -0.157647861 [41] 0.128403958 -0.030368545 -0.074083044 0.055217539 0.068831844 [46] -0.180448176 0.216525291 -0.078895726 -0.077892934 0.103450013 [51] -0.048031747 -0.118064215 0.205283679 -0.120811029 0.011594934 [56] 0.137411251 -0.191005239 0.045505969 0.055571299 -0.088129372 [61] 0.065471150 > (mypacf <- c(rpacf$acf)) [1] -0.501361146 -0.411095625 -0.101013186 -0.219100393 -0.172314746 [6] 0.118887461 -0.105393903 -0.234011310 0.144479961 0.069758324 [11] 0.066667202 0.014858646 -0.152773261 -0.109969504 -0.084851677 [16] -0.234522679 0.038080443 0.139870339 0.010923748 -0.161195185 [21] 0.028727262 -0.087501316 0.225124286 0.017271881 -0.004995816 [26] -0.275587902 -0.021629891 -0.087509016 -0.019709758 0.055092485 [31] 0.004667687 -0.048476574 0.029758141 -0.060595238 0.032383246 [36] -0.072962528 0.106965505 0.061710227 0.068830438 -0.096043741 [41] -0.077534234 -0.068434634 -0.014683767 0.036958891 -0.005663129 [46] -0.036809210 0.108042886 -0.024277858 0.037558372 -0.009308370 [51] -0.036201431 0.021752565 -0.038473520 -0.072769917 -0.025396466 [56] -0.028939826 0.029959971 -0.081097698 -0.010541141 -0.048964036 > 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/308wd1229680043.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/4a2a01229680043.tab") > > system("convert tmp/19kxf1229680043.ps tmp/19kxf1229680043.png") > system("convert tmp/201d11229680043.ps tmp/201d11229680043.png") > > > proc.time() user system elapsed 0.598 0.319 0.707