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(99.4,102.7,109.3,93.9,95.3,101.8,85.6,81.1,109.5,104.0,94.5,79.0,92.8,95.6,101.7,90.8,89.5,91.8,83.8,77.4,112.7,98.8,85.7,72.8,96.9,95.0,94.2,87.3,80.6,87.9,79.6,71.9,94.6,91.4,86.6,68.5,90.1,91.6,95.4,85.4,81.6,88.9,84.1,74.7,97.1,95.3,85.1,67.3,80.6,87.9,89.2,81.3,79.7,83.7,82.1,69.3,91.2,85.7,85.2,70.0,85.8,91.4,97.5,87.1,85.1,94.1,85.8,74.7,99.9,90.7,86.8,74.8,91.8,97.6,100.8,85.4,84.0,90.6,80.5,73.9,93.6) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '1' > par3 = '1' > 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/1sewt1260966831.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/27fcw1260966831.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.298604747 -0.160808697 -0.068194286 0.178747847 [6] 0.026570282 -0.047544283 0.095109302 -0.330622230 0.278104514 [11] -0.073384496 0.138286914 -0.305586884 0.030683439 0.050925717 [16] -0.041923184 0.090205939 -0.221235299 0.191064099 -0.102273097 [21] 0.100743551 -0.026698690 0.041723210 -0.048357838 -0.055905807 [26] 0.208001643 -0.166466776 0.142616895 -0.131378528 0.104203644 [31] -0.092983850 0.111610108 -0.041712881 -0.199319658 0.215592237 [36] 0.002570270 -0.047786133 -0.139003048 0.145784178 -0.045521627 [41] 0.007393260 -0.010755422 -0.030389796 -0.005948450 0.046010554 [46] 0.057387151 -0.097948481 0.002507853 0.029342698 > (mypacf <- c(rpacf$acf)) [1] -0.298604747 -0.274444258 -0.250930102 0.017336386 0.060095985 [6] 0.046582851 0.193565937 -0.300994825 0.103551678 -0.105555021 [11] 0.136620207 -0.193746144 -0.126577690 -0.145985636 -0.152760253 [16] -0.041864578 -0.129561075 0.055693404 0.037530120 -0.077746769 [21] 0.142568829 0.031301814 0.053824766 -0.074873139 0.028452438 [26] -0.083782249 0.041595535 -0.071318322 -0.003384615 -0.081980092 [31] 0.093956414 -0.080607855 -0.088879063 0.058557200 0.184341989 [36] -0.115499023 0.074481515 -0.099029456 0.093848730 -0.109083484 [41] -0.039186637 0.001568044 -0.080973189 0.029833667 -0.060203148 [46] 0.002935680 0.051894136 -0.056279327 > 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/347vd1260966831.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/4a1eh1260966831.tab") > > try(system("convert tmp/1sewt1260966831.ps tmp/1sewt1260966831.png",intern=TRUE)) character(0) > try(system("convert tmp/27fcw1260966831.ps tmp/27fcw1260966831.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.570 0.313 1.204