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 = '1' > 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/1rs8o1229680354.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/2lik91229680354.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.0000000000 0.7477913065 0.6948012644 0.6312195395 0.4759464966 [6] 0.4206824995 0.3332350248 0.2208659863 0.1705838997 0.1672518333 [11] 0.0400789968 0.0405831119 0.0197254765 0.0008563332 0.0765660384 [16] 0.0891780526 0.0738137616 0.1717258096 0.1962681030 0.1551758577 [21] 0.2084876917 0.1584808618 0.0732962924 0.1156189138 -0.0291389119 [26] -0.0679530568 -0.0687869889 -0.1745206547 -0.2047348650 -0.2698587568 [31] -0.3394068929 -0.3526266680 -0.3096071926 -0.3396288756 -0.2863862694 [36] -0.2476247821 -0.2453720919 -0.1894514756 -0.1709100243 -0.1794804145 [41] -0.1507509169 -0.1155314457 -0.1498934734 -0.0989386311 -0.1457984901 [46] -0.1803695740 -0.1413858362 -0.2091028380 -0.2349362772 -0.2252960134 [51] -0.2677551856 -0.2541674778 -0.2222707340 -0.2081900632 -0.1823832329 [56] -0.1259738578 -0.1330076190 -0.1099104377 -0.0737840168 -0.0361916592 [61] 0.0137566155 > (mypacf <- c(rpacf$acf)) [1] 0.7477913065 0.3076381929 0.1038425647 -0.2146541595 0.0003332281 [6] -0.0254044710 -0.0981554918 -0.0155997473 0.1690872711 -0.2026480002 [11] 0.0198515817 0.0364326979 0.1023154974 0.1431051632 0.0539324096 [16] -0.1028945134 0.1585427229 0.0404849855 -0.1339922858 -0.0020681542 [21] -0.0301085144 -0.2317991807 0.0869446361 -0.2049511779 0.0639142587 [26] 0.0134277509 -0.0756466692 -0.0653541348 -0.1388079531 -0.0468847797 [31] 0.0444276850 0.0413865587 0.0601952941 -0.0444082090 -0.0890969681 [36] 0.0099216182 -0.0304817750 -0.0108546034 0.0202610866 -0.1170524382 [41] 0.0431831826 0.0175868202 0.0401147425 -0.0843197562 0.0042579855 [46] -0.0012551618 -0.0081381949 -0.0754453952 0.0358667632 -0.0340675626 [51] -0.0045800575 -0.0050158659 0.0703207798 -0.0581045429 0.0307717422 [56] -0.0924287552 -0.0049786807 -0.0301125615 0.1531074698 -0.0502085097 > 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/35lxo1229680354.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/46mcu1229680354.tab") > > system("convert tmp/1rs8o1229680354.ps tmp/1rs8o1229680354.png") > system("convert tmp/2lik91229680354.ps tmp/2lik91229680354.png") > > > proc.time() user system elapsed 0.627 0.325 1.087