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(148.8,146.7,118.8,99.4,97.6,110.2,146.6,136.4,126.2,154.9,109,128.5,144.9,136.3,134.8,103.4,106.6,119.2,149.3,150.2,142.9,163.6,98.2,138.2,143.7,132.8,149.4,128.8,98.9,106.2,140.7,133,156.4,157.7,107.9,133.6,148.1,205.6,193.1,117.5,116.4,129.5,157.1,157,158.4,161.7,116.9,161.1,155.7,160.8,145.4,111,144.8,149.2,156.6,182.5,171.3,172.7,133,148.1) > par5 = '12' > par4 = '1' > par3 = '0' > par2 = '0.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/rcomp/tmp/1hqoq1228913182.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/23ry11228913182.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.264098295 -0.188283806 -0.051459456 -0.008792838 [6] 0.094084408 -0.004220907 -0.208382432 -0.267423878 -0.079830834 [11] 0.153339574 0.056685627 -0.343461358 -0.266845405 -0.006453595 [16] 0.108220260 -0.008768844 0.045408862 0.115899619 0.020471784 [21] 0.221263183 0.142944677 -0.107371669 -0.066621565 -0.086943364 [26] -0.069484239 0.073647937 0.013659749 0.041151709 -0.013172769 [31] -0.087601397 -0.011152382 0.006338229 -0.030452351 -0.044227825 [36] -0.026091903 0.017710564 0.096027499 0.071195456 -0.008510094 [41] -0.045470050 0.017920388 -0.009693681 -0.020347354 0.003343279 [46] -0.027367012 0.012670825 0.012349084 > (mypacf <- c(rpacf$acf)) [1] 0.2640982954 -0.2773782701 0.0993546941 -0.0879680401 0.1516636162 [6] -0.1233445705 -0.1343943146 -0.2207736485 0.0040877296 0.0842634491 [11] -0.0414835638 -0.3688577625 -0.0613339852 -0.1303762099 0.0318030954 [16] -0.2606347332 0.2484971422 -0.0254145152 -0.0309638512 0.0258616330 [21] -0.0562663058 -0.0421213994 0.0165547787 -0.3102484540 -0.0145358307 [26] 0.0308412033 0.0532135998 -0.0245927147 -0.0121272386 -0.0077038930 [31] -0.0867035701 0.0301431506 -0.0676687247 0.0380664859 -0.0761535624 [36] -0.0395635152 -0.0856601594 -0.0238955339 0.0300800456 0.0003424009 [41] -0.0193781150 0.0256011609 -0.1260874570 0.0871113723 -0.0465713533 [46] -0.0487499600 -0.0930308257 > 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/32ut61228913182.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/4bhco1228913182.tab") > > system("convert tmp/1hqoq1228913182.ps tmp/1hqoq1228913182.png") > system("convert tmp/23ry11228913182.ps tmp/23ry11228913182.png") > > > proc.time() user system elapsed 0.595 0.335 0.774