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(220206,220115,218444,214912,210705,209673,237041,242081,241878,242621,238545,240337,244752,244576,241572,240541,236089,236997,264579,270349,269645,267037,258113,262813,267413,267366,264777,258863,254844,254868,277267,285351,286602,283042,276687,277915,277128,277103,275037,270150,267140,264993,287259,291186,292300,288186,281477,282656,280190,280408,276836,275216,274352,271311,289802,290726,292300,278506,269826,265861,269034,264176,255198,253353,246057,235372,258556,260993,254663,250643,243422,247105,248541,245039,237080,237085,225554,226839,247934,248333,246969,245098,246263,255765,264319) > 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: 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/rcomp/tmp/1ufar1242238286.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/rcomp/tmp/26fo51242238286.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.902891067 0.784001031 0.689987534 0.625373022 [6] 0.592352138 0.539403244 0.478910537 0.417014612 0.392264709 [11] 0.399083009 0.428817295 0.433001436 0.327009434 0.208595540 [16] 0.108768105 0.043410893 0.005772895 -0.050601704 -0.100540653 [21] -0.146294066 -0.158687046 -0.143159981 -0.117963901 -0.104011102 [26] -0.170990866 -0.247633795 -0.308582739 -0.340730891 -0.357457903 [31] -0.385245228 -0.404301137 -0.416945915 -0.400399161 -0.368518850 [36] -0.326328523 -0.295292379 -0.333792896 -0.380623063 -0.411153714 [41] -0.416624301 -0.409869190 -0.414524717 -0.411417480 -0.402913903 [46] -0.365759246 -0.319240266 -0.266073366 -0.218055835 > (mypacf <- c(rpacf$acf)) [1] 0.9028910670 -0.1689032582 0.0838928821 0.0756122605 0.1185282522 [6] -0.1435445687 0.0036060137 -0.0357768901 0.1772079486 0.0730075657 [11] 0.1623505517 -0.1127098777 -0.5205607693 -0.0492745408 -0.0766268053 [16] 0.0162838355 0.0138640778 -0.0006603816 0.0938857715 -0.0360837522 [21] -0.0086337669 -0.0419289626 -0.0587817096 0.0651705198 -0.1624973760 [26] -0.0025841938 -0.0245150321 -0.0103716607 -0.0731827845 0.0257077703 [31] -0.0107789519 -0.0007568880 -0.0297212346 -0.0427988130 0.0200646536 [36] -0.0465934580 -0.1287609912 -0.0341441824 0.0116901576 0.0079962900 [41] -0.0277505040 -0.0007565276 -0.0085424309 -0.0539995890 0.0090653546 [46] -0.0526002001 -0.0002431282 0.0413338047 > 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/3d5ff1242238286.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/44a321242238286.tab") > > system("convert tmp/1ufar1242238286.ps tmp/1ufar1242238286.png") > system("convert tmp/26fo51242238286.ps tmp/26fo51242238286.png") > > > proc.time() user system elapsed 0.579 0.324 0.694