R version 2.8.0 (2008-10-20) Copyright (C) 2008 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(93803,90684,87251,83606,79695,75858,89756,98707,89871,84625,81979,84525,85826,82652,81514,77360,74095,71637,84186,92713,81321,76536,73038,74940,74654,71999,68611,67430,65460,63421,76226,84540,74255,70680,67409,67938,70051,68043,67383,67028,65478,65133,78443,85418,84786,83684,80369,82361,83071,81881,80767,78375,76381,76068,94619,99126,93632,91541,90445,91621,93856,91738,89952,89365,87146,88689,108165,113374,106099,103235,98857,101107,102700,101477,99639,96622,94697,95093,112885,121162,113624,111632,106707,108827,108413,106249,104861,102382,100320,100228,117089,121523,114948,112831,107605,108928,101993,102850,99925,101536,99450,98305,110159,109483,106810,96279,91982,90276,90999,86622,83117,80367,77550,77443,92844,92175,84822,81632,78872,81485) > par5 = '12' > par4 = '1' > par3 = '1' > par2 = '1' > par1 = '60' > #'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: Write here your technical program description (don't use hard returns!) > 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 (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/freestat/rcomp/tmp/1jswj1229008514.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > racf <- acf(x,par1,main='Autocorrelation',xlab='lags',ylab='ACF') > dev.off() null device 1 > postscript(file="/var/www/html/freestat/rcomp/tmp/2ncbh1229008514.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.168379437 0.156086406 -0.172847297 0.103357155 [6] 0.076214316 0.042910814 0.101218935 -0.154425807 0.198523724 [11] -0.085088096 0.155891729 -0.297160011 0.133747020 0.024875422 [16] -0.031561109 0.036285679 -0.104925292 0.028429963 0.004879989 [21] 0.110457371 0.015478874 0.022098472 -0.114693379 -0.129529321 [26] 0.065378541 -0.081422858 0.118544953 -0.024820304 -0.020241589 [31] -0.022744699 -0.058878027 0.028856903 0.009030644 -0.010511984 [36] 0.121012776 -0.036853965 -0.002509816 -0.039035855 0.004624821 [41] -0.030072102 0.060044084 -0.123528919 0.010701117 -0.053827619 [46] -0.010985824 0.049801883 -0.092531352 0.010169781 -0.069631766 [51] 0.094088692 -0.102258188 -0.044169331 -0.021093910 0.123390092 [56] 0.032743399 -0.023454382 -0.064693414 -0.165073583 0.006918137 [61] 0.049321350 > (mypacf <- c(rpacf$acf)) [1] -0.1683794372 0.1314619315 -0.1339312987 0.0438390260 0.1440272481 [6] 0.0322890873 0.1137665993 -0.1180053569 0.1464935332 0.0006365693 [11] 0.0463727116 -0.2470655132 0.0425025613 0.1236086083 -0.1346027953 [16] 0.0095946351 0.0061196720 -0.0466977180 0.0974844700 0.0077681286 [21] 0.1384080829 0.0390967805 -0.1403082747 -0.2473204779 0.0776446399 [26] -0.0405574025 -0.0226458066 0.1076212281 -0.0326315370 -0.0077068876 [31] -0.0169727370 -0.0228019846 0.1624231969 -0.0525973154 0.1179791618 [36] -0.0913569401 0.0484946143 -0.0701716623 -0.0708410153 0.0097428102 [41] -0.0475280095 -0.1630877259 0.0560562438 -0.0210240909 0.1015929323 [46] -0.0203950901 -0.0245310210 -0.0986837772 0.0115252670 0.0615563082 [51] -0.0152258282 -0.1159902303 0.0461905843 0.0317583963 0.0370681872 [56] -0.0271764110 -0.0360675723 -0.1367817161 -0.0393571659 -0.0385358976 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/html/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/3xsk11229008515.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/freestat/rcomp/tmp/4aev91229008515.tab") > > system("convert tmp/1jswj1229008514.ps tmp/1jswj1229008514.png") > system("convert tmp/2ncbh1229008514.ps tmp/2ncbh1229008514.png") > > > proc.time() user system elapsed 0.832 0.420 0.971