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(15.59,13.17,11.20,13.30,10.78,11.60,15.18,15.87,12.58,11.43,10.30,11.17,11.26,11.20,9.99,11.17,10.29,10.47,14.36,16.06,14.47,13.24,13.03,14.43,13.98,13.62,12.20,12.24,12.07,12.30,16.12,18.38,14.59,12.96,14.14,13.92,14.24,14.10,12.91,13.69,14.11,13.99,17.93,21.37,16.25,14.53,15.36,14.95,15.95,15.25,12.67,13.86,14.65,12.41,17.46,18.95,15.33,15.31,14.84,14.75,15.83,14.83,13.00,13.92,13.94,12.54,18.12,17.83,14.41,15.18,12.99,13.06,12.81,12.95,10.48,13.23,11.80,11.69,15.33,14.89,12.92,11.27,10.68,11.55) > par5 = '12' > par4 = '0' > par3 = '0' > 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/rcomp/tmp/13ymk1229679967.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/2cyl31229679967.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.00000000 0.57753860 0.21979951 0.19097161 0.07944968 0.12870154 [7] 0.25275890 0.11762437 0.06681287 0.10701895 0.03915541 0.34212452 [13] 0.60096062 0.25393608 -0.03924393 -0.08062789 -0.14700325 -0.06108531 [19] 0.03693463 -0.07146787 -0.08892418 -0.09732178 -0.12368591 0.16524080 [25] 0.33854826 0.06302177 -0.19251937 -0.25596734 -0.28595533 -0.23213603 [31] -0.16457351 -0.22107819 -0.23742743 -0.25324788 -0.23280128 -0.01690595 [37] 0.13847937 -0.04110220 -0.25632838 -0.29291534 -0.27572707 -0.20839591 [43] -0.12611406 -0.12919519 -0.15966517 -0.14784453 -0.12816249 -0.01364030 [49] 0.10531852 -0.01540961 -0.16953853 -0.17160115 -0.16181242 -0.11880381 [55] -0.02626680 -0.03000012 -0.05681590 -0.03443657 -0.02158622 0.05956434 [61] 0.15216362 > (mypacf <- c(rpacf$acf)) [1] 0.5775385975 -0.1706826714 0.2178214299 -0.1828275870 0.2849218958 [6] 0.0415089668 -0.1201723281 0.1087441127 -0.0295931862 0.0109115458 [11] 0.5624327282 0.0902087093 -0.4169994394 -0.2070155822 -0.0243475893 [16] 0.0659669630 -0.0897549595 -0.1149594969 -0.0046635156 -0.0162090671 [21] 0.0010169839 0.1069493591 0.0332935664 -0.0608800727 -0.0334050543 [26] -0.1094884613 -0.0062619735 -0.0649722294 -0.2426283766 0.0032807612 [31] -0.0544086099 -0.0353747443 0.0213428006 -0.0588581491 -0.1072204391 [36] 0.1108470347 0.0499737743 0.0422190952 -0.0677137123 -0.0147793481 [41] 0.1000536244 0.0263700333 -0.0203748892 -0.0492527698 -0.0004210328 [46] -0.0798654073 -0.1392396761 -0.0644569253 0.0393861147 0.0898426921 [51] -0.0262072027 -0.0590382021 0.0360806792 0.0432622719 0.0405703584 [56] 0.0060727390 -0.0908132922 0.0300854839 0.0075816281 -0.0458391361 > 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/3ox141229679967.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/4y9zm1229679967.tab") > > system("convert tmp/13ymk1229679967.ps tmp/13ymk1229679967.png") > system("convert tmp/2cyl31229679967.ps tmp/2cyl31229679967.png") > > > proc.time() user system elapsed 0.613 0.327 0.703