R version 2.7.0 (2008-04-22) 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(100.03,100.49,108.76,105.28,104.55,108.91,105.83,82.12,113.71,117.53,104.75,104.3,102.82,106.86,123.1,112.02,103.66,121.78,107.81,93.54,119.41,117.99,116.82,112.62,105.76,107.86,122.06,114.29,109.95,119.99,103.77,96.02,120.83,110.14,119.77,113.61,106.83,108,126.39,105.09,118.95,120.6,106.07,96.59,118.74,121.88,120.89,105.66,113.76,111.92,127.19,109.19,118.05,123.23,114.68,104.57,115.73,129.87,120.31,104.23,123.92,124.1,125.61,133.91,124.47,129.64,128.58,103.55,129.57) > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '1' > par1 = '36' > #'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/1k7iu1229779600.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/2t47u1229779600.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.179589231 0.020307952 0.293958145 0.230048767 [6] 0.184084598 0.335717039 0.072065153 0.184730414 0.075334710 [11] -0.138432187 0.096390780 0.496167946 -0.001345864 -0.123336321 [16] 0.042442233 0.065493269 -0.006574507 0.181663544 -0.014624022 [21] 0.050507854 -0.067597811 -0.166344455 0.061718599 0.273987431 [26] -0.036365557 -0.099275262 -0.030650693 0.063585338 -0.051762680 [31] 0.074009363 0.003971259 -0.004394723 -0.105496604 -0.138260327 [36] -0.040086745 0.199056190 > (mypacf <- c(rpacf$acf)) [1] 0.179589231 -0.012342411 0.302276270 0.139435079 0.159458158 [6] 0.264118664 -0.090317967 0.150071661 -0.208224418 -0.288070787 [11] -0.037008994 0.465611447 0.037116264 -0.112105277 -0.133421600 [16] -0.027651497 -0.147381637 0.112201808 0.024494937 0.065867508 [21] -0.068980928 0.003551078 0.020266039 -0.041083042 0.079164632 [26] 0.021267313 -0.005932324 0.071645613 -0.125834538 -0.093147958 [31] -0.099031210 0.018409860 0.074081549 0.012793794 -0.032536429 [36] 0.056566939 > 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/3vymz1229779600.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/4a8f71229779601.tab") > > system("convert tmp/1k7iu1229779600.ps tmp/1k7iu1229779600.png") > system("convert tmp/2t47u1229779600.ps tmp/2t47u1229779600.png") > > > proc.time() user system elapsed 1.473 0.553 1.564