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(517,510,509,501,507,569,580,578,565,547,555,562,561,555,544,537,543,594,611,613,611,594,595,591,589,584,573,567,569,621,629,628,612,595,597,593,590,580,574,573,573,620,626,620,588,566,557,561,549,532,526,511,499,555,565,542,527,510,514,517,508,493,490,469,478,528,534,518,506,502,516,528) > par5 = '12' > par4 = '0' > 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: 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/1yoij1242322583.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/2hobn1242322583.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.261870183 -0.201020284 -0.309947393 -0.267140906 [6] 0.085221319 0.201498289 0.047098092 -0.244639214 -0.277805452 [11] -0.159202597 0.250991236 0.747742037 0.174860517 -0.168780994 [16] -0.263620946 -0.215712498 0.064730398 0.123743145 0.019330327 [21] -0.230224387 -0.227703385 -0.090600500 0.188098545 0.553450344 [26] 0.117276006 -0.184601551 -0.264344658 -0.163440619 0.053746984 [31] 0.091556874 0.009992162 -0.189449526 -0.145917327 -0.063854199 [36] 0.129198962 0.420872369 0.087508589 -0.175585619 -0.219302857 [41] -0.112911464 0.042229428 0.097761235 -0.003205576 -0.152088556 [46] -0.103297760 -0.061138103 0.078029793 0.294365473 > (mypacf <- c(rpacf$acf)) [1] 0.2618701830 -0.2894452739 -0.1948373090 -0.2118142428 0.1193752091 [6] -0.0008974805 -0.0808249812 -0.2705808750 -0.1240484282 -0.1976659204 [11] 0.1820800426 0.6217848975 -0.1548844427 0.1309236603 0.0509486768 [16] 0.0594872750 -0.1214747085 -0.0843195232 0.0210674200 -0.1038743498 [21] 0.0068572685 0.0151797017 -0.1191025284 0.0268970232 -0.0333684652 [26] -0.1287750346 -0.1417545762 0.0255190730 -0.0712562081 -0.0462698600 [31] -0.0146817526 0.0681343446 0.0324304606 -0.0798880175 0.0006062258 [36] -0.0086203205 -0.0020432070 -0.0420489430 0.0384672351 0.0124974949 [41] -0.0142496770 0.0907508687 -0.0877334885 -0.0088260364 -0.0675238300 [46] -0.0451693581 -0.1377212610 -0.1133931028 > 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/33sq31242322583.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/456fk1242322583.tab") > > system("convert tmp/1yoij1242322583.ps tmp/1yoij1242322583.png") > system("convert tmp/2hobn1242322583.ps tmp/2hobn1242322583.png") > > > proc.time() user system elapsed 0.791 0.435 0.916