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(2834,4683,4120,3849,8435,12854,15883,10520,12562,5060,4520,2150,2905,4820,3950,4053,8700,13520,15400,11100,11950,4900,4633,2300,2945,3960,3900,3767,8820,11980,14085,11600,9814,4930,4360,2640,3050,5485,4366,4790,10100,14830,17930,13580,12490,6400,4980,4930,5856,5120,5100,5623,12035,19846,17030,15860,14890,8053,6080,5987,5682,4980,5450,6035,13240,18400,17689,16490,14062,9556,7555,4328) > 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/1xdl01289935146.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/2xdl01289935146.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.758969633 0.407246077 -0.010304851 -0.339036634 [6] -0.540226923 -0.580292593 -0.491507660 -0.288461199 0.007505636 [11] 0.345941900 0.642215235 0.783923813 0.596616777 0.309538757 [16] -0.038256983 -0.295470995 -0.464275907 -0.498977003 -0.423776859 [21] -0.265881727 -0.035313134 0.243045557 0.465830873 0.564719507 [26] 0.425146769 0.193323487 -0.068905658 -0.270731239 -0.404300819 [31] -0.421288555 -0.361306777 -0.237112476 -0.052185248 0.155253001 [36] 0.333289747 0.405162532 0.283552646 0.115353711 -0.080652519 [41] -0.234733872 -0.337656469 -0.336182887 -0.281125027 -0.181737166 [46] -0.036187557 0.106263014 0.239198814 0.277983683 > (mypacf <- c(rpacf$acf)) [1] 0.758969633 -0.398119627 -0.393212742 -0.129537821 -0.134403974 [6] -0.098093463 -0.100985710 0.006210195 0.182709426 0.287301757 [11] 0.326068845 0.244992837 -0.390498335 0.136539362 0.153996169 [16] 0.137195319 -0.083305086 -0.119907413 0.030042196 -0.025513568 [21] -0.066150674 -0.007616963 -0.188674959 0.033480887 -0.065033997 [26] -0.100311228 0.025686655 -0.108540317 -0.021434055 0.019591813 [31] -0.064661289 0.011846422 -0.041480925 -0.068442275 0.090151180 [36] -0.031511084 -0.111286171 0.069136133 0.002493105 0.004934765 [41] -0.081778706 0.054829152 0.066556480 -0.076944071 0.053590476 [46] -0.124336095 0.006831419 0.089148710 > 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/3cmjq1289935146.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/4md0b1289935146.tab") > > try(system("convert tmp/1xdl01289935146.ps tmp/1xdl01289935146.png",intern=TRUE)) character(0) > try(system("convert tmp/2xdl01289935146.ps tmp/2xdl01289935146.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.559 0.327 0.712