R version 2.9.0 (2009-04-17) Copyright (C) 2009 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(93.2,96,95.2,77.1,70.9,64.8,70.1,77.3,79.5,100.6,100.7,107.1,95.9,82.8,83.3,80,80.4,67.5,75.7,71.1,89.3,101.1,105.2,114.1,96.3,84.4,91.2,81.9,80.5,70.4,74.8,75.9,86.3,98.7,100.9,113.8,89.8,84.4,87.2,85.6,72,69.2,77.5,78.1,94.3,97.7,100.2,116.4,97.1,93,96,80.5,76.1,69.9,73.6,92.6,94.2,93.5,108.5,109.4,105.1,92.5,97.1,81.4,79.1,72.1,78.7,87.1,91.4,109.9,116.3,113,100,84.8,94.3,87.1,90.3,72.4,84.9,92.7,92.2,114.9,112.5,118.3,106,91.2,96.6,96.3,88.2,70.2,86.5,88.2,102.8,119.1,119.2,125.1) > 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/html/rcomp/tmp/1f32i1273096622.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/html/rcomp/tmp/2f32i1273096622.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.70190868 0.39279188 0.02450981 -0.29331238 -0.45022186 [7] -0.55650163 -0.40923246 -0.21224100 0.08633068 0.35062057 0.62457346 [13] 0.76163540 0.54683431 0.31278079 -0.02078454 -0.26275348 -0.43929302 [19] -0.53535914 -0.39425711 -0.20303290 0.07032382 0.29202250 0.52284424 [25] 0.60997142 0.45425899 0.23027657 -0.04567346 -0.26777596 -0.42176768 [31] -0.49165442 -0.35329259 -0.14008016 0.06026980 0.26339042 0.41790093 [37] 0.46400573 0.35619735 0.13620493 -0.07048040 -0.25618715 -0.38828965 [43] -0.43227789 -0.31296166 -0.15989731 0.01087809 0.20899570 0.30827382 [49] 0.38372999 > (mypacf <- c(rpacf$acf)) [1] 0.701908678 -0.196883795 -0.343029741 -0.249450993 -0.043072136 [6] -0.249092253 0.164050609 0.005741911 0.189329512 0.106170254 [11] 0.474261567 0.265225039 -0.263873486 0.112444679 0.107399765 [16] 0.010016603 -0.094040925 -0.075166742 0.016343942 -0.045405556 [21] -0.024292334 -0.072468981 0.011101940 0.068833483 -0.050030532 [26] -0.098326933 0.102993190 -0.093361246 0.089385366 -0.059092720 [31] 0.087306774 0.057991441 -0.141352546 0.065268790 -0.064265275 [36] -0.043252281 0.069329473 -0.143175288 0.069427156 -0.038602932 [41] -0.025298999 0.014637518 -0.090638753 -0.119420354 0.029115865 [46] 0.060141905 -0.089720806 -0.036342094 > 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/3tc091273096622.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/444zc1273096622.tab") > > try(system("convert tmp/1f32i1273096622.ps tmp/1f32i1273096622.png",intern=TRUE)) character(0) > try(system("convert tmp/2f32i1273096622.ps tmp/2f32i1273096622.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.581 0.320 0.748