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(66857.2,64722.8,68489.6,71342.9,63542.5,69425.0,58927.9,61009.0,66837.0,66147.6,65982.3,65527.5,65914.6,59189.9,66211.4,66400.8,60167.7,64547.9,57706.2,58642.6,60082.1,63414.8,66044.0,57628.5,62838.8,55758.6,61004.5,66173.4,57489.0,59552.2,57061.8,55895.3,56314.7,61232.8,60014.1,57685.4,60403.1,52349.7,55693.3,65676.1,54898.8,55518.2,53779.1,52340.9,55704.4,60330.3,52837.4,55388.1,60383.4,52070.3,54077.0,62887.8,49212.8,57722.0,53936.8,46991.0,54984.2,56485.1,51277.8,53596.4,54252.5,49413.0,53213.2,58695.3,48723.5,54510.0,49454.1,46136.6,54622.5,50583.0,53224.3,53056.4) > 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/1xe8e1272896679.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/2xe8e1272896679.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.539924725 0.550460686 0.646827593 0.385532395 [6] 0.528100833 0.587477939 0.435440478 0.347911910 0.485722532 [11] 0.323102249 0.303594675 0.566019520 0.224465218 0.259114013 [16] 0.283093415 0.073313940 0.231640166 0.225371452 0.143156213 [21] 0.065490899 0.127073561 0.063558098 0.035006123 0.203855936 [26] 0.006224440 -0.009222906 0.021376695 -0.125393204 -0.031362156 [31] -0.046505308 -0.085963257 -0.152370666 -0.123199338 -0.120598469 [36] -0.190214003 -0.059830254 -0.173892804 -0.223494041 -0.153334720 [41] -0.265788125 -0.231233280 -0.211801555 -0.229400770 -0.278465511 [46] -0.243715890 -0.223186745 -0.303016123 -0.173087584 > (mypacf <- c(rpacf$acf)) [1] 0.5399247254 0.3654888003 0.4250446183 -0.1711983081 0.2091567659 [6] 0.2554499063 0.0517063078 -0.4008110009 0.2435324556 0.0220177650 [11] -0.1030816566 0.2809396536 -0.2039780158 -0.1610871810 -0.2549127435 [16] 0.0996854737 0.1156245730 -0.1151600244 0.0498660868 -0.0607758334 [21] 0.0057100881 0.0972615521 0.0004249564 -0.0407357999 0.0453958801 [26] -0.1351614915 -0.0236441997 -0.0708214087 -0.0078973036 -0.1122512814 [31] -0.0623242574 0.0778499453 0.0182290073 0.0140929328 -0.0728828661 [36] -0.0129817105 0.0230641657 -0.0160180046 0.0111647545 -0.0417009821 [41] -0.1130968793 -0.0224686809 0.0534784476 0.0064701601 -0.0199492997 [46] -0.0475113008 0.0050364668 0.0130653339 > 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/3to6n1272896679.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/44f681272896679.tab") > > try(system("convert tmp/1xe8e1272896679.ps tmp/1xe8e1272896679.png",intern=TRUE)) character(0) > try(system("convert tmp/2xe8e1272896679.ps tmp/2xe8e1272896679.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.581 0.312 0.693