R version 2.11.1 (2010-05-31) Copyright (C) 2010 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(102.8,106.3,103.7,106.9,104.3,105.4,96.2,95.7,95.9,93.6,94.7,94.5,96.6,96.7,98.9,102,105.2,106.4,99.3,96.4,93.1,95.6,93.3,96.7,105.6,105.2,107,104.9,104.5,105.2,99.7,100.2,98.5,98.4,97.1,98.4,100.6,111.3,119,117.8,108.8,109.3,103.5,103.7,110,105.5,110.4,106.7,110.2,105.2,108,108.1,107.2,106,99.4,100.2,100.3,100.8,99.5,100.2,103,111,120.5,109.5,106.6,105.5,103.9,104.9,104.8,99.6,97,95.4,99.3,103.9,107.4,107.4,111,113.2,108.5,113.3,113.8,105.3,107.5,109.4,118.9,119,115,124.1,120.5,117.7,117.1,118.1,119.6,118.8,124.9,124,124.9,121.7,121.6,125.1,127.9,129,130.1,130.3,127.9,124.1,125.7,129.2,129.2,132.6,131.5,131,125.8,127.2,127.3,127.5,122,118.4,118.3,115.5) > 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/rcomp/tmp/111xz1290270496.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/rcomp/tmp/211xz1290270496.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.00000000 0.93314968 0.86649238 0.79884359 0.74776613 0.71268838 [7] 0.68315806 0.67175205 0.65088837 0.64044841 0.62811855 0.62070381 [13] 0.60318809 0.56119081 0.51914188 0.46540373 0.40123117 0.34928346 [19] 0.30946792 0.27783177 0.26862523 0.26649696 0.27524932 0.26541502 [25] 0.23040448 0.17987085 0.13211638 0.09235487 0.04637571 0.01426682 [31] -0.01547070 -0.03541096 -0.04303572 -0.03729768 -0.02078616 -0.01909066 [37] -0.01730232 -0.03540529 -0.04071764 -0.05220823 -0.06997733 -0.07673870 [43] -0.09801313 -0.10111715 -0.09831613 -0.06753711 -0.04078904 -0.02105245 [49] -0.01037837 > (mypacf <- c(rpacf$acf)) [1] 0.933149679 -0.033087430 -0.043391166 0.090980684 0.095321544 [6] 0.019724207 0.136322965 -0.053725384 0.092228643 0.025047335 [11] 0.054920926 -0.063043432 -0.167987107 -0.020828390 -0.100016559 [16] -0.190282085 0.023065987 -0.004402263 -0.051232267 0.162858263 [21] 0.030824192 0.099054174 -0.075847013 -0.163490320 -0.085934574 [26] 0.016830840 0.012052600 -0.068737001 -0.006341469 0.015999775 [31] 0.024349394 0.012386464 0.080329449 0.045148404 -0.057593604 [36] 0.103504106 -0.071580483 0.169643286 0.046493436 -0.085094180 [41] 0.051129134 -0.161898496 0.018702273 -0.011412031 0.106404347 [46] 0.020921547 0.021020369 -0.032448178 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/rcomp/tmp/3ftu81290270496.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/rcomp/tmp/4jbtw1290270496.tab") > > try(system("convert tmp/111xz1290270496.ps tmp/111xz1290270496.png",intern=TRUE)) character(0) > try(system("convert tmp/211xz1290270496.ps tmp/211xz1290270496.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.750 0.570 1.298