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(0,1,0,0,1,3,9,2,3,5,3,5,2,2,0,1,0,1,3,3,2,1,1,5,0,3,1,0,1,4,0,0,1,6,14,1,1,0,0,1,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,0,2,0,1,0,1,0,0,1,2,0,0,1,2,0,3,1,1,0,2,0,4,0,2,1,1,1,1,0,1,1,0,2,1,3,1,2,4,0,0,0,1,0,1,0,2,2,4,2,3,3,0,0,2,7,8,2,4,1,1,2,4) > 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/11nkf1244118270.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/27dff1244118270.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.2827620206 0.1164498905 -0.0322222866 0.0097361729 [6] 0.0879012152 0.0508935811 0.0152759621 0.0363180046 -0.0165755159 [11] 0.0179033388 0.0938509760 0.0502407705 0.0370619660 0.0843322688 [16] 0.0025297447 0.0189053080 0.0043861318 -0.0251418974 -0.0533295549 [21] -0.0151108978 -0.0066782777 0.0114513522 0.1070246783 0.0203736493 [26] 0.0994157248 -0.0289357559 0.0558318578 0.1496511173 0.0001019069 [31] -0.1033120418 -0.0982055292 -0.1019189930 -0.0052369645 -0.0431216318 [36] -0.0749994484 -0.0319322864 -0.0484371983 -0.0303075684 -0.0150407076 [41] 0.0011031866 -0.0478188623 -0.0475608545 -0.0828144220 -0.0638077587 [46] 0.0110311761 -0.0363684753 -0.0724990761 -0.0177491685 > (mypacf <- c(rpacf$acf)) [1] 0.2827620206 0.0396670868 -0.0817115854 0.0378012452 0.0956468893 [6] -0.0059621533 -0.0144363567 0.0493932953 -0.0390268374 0.0167876794 [11] 0.1019863440 -0.0084704505 0.0007731049 0.0994436804 -0.0502959965 [16] -0.0060574736 0.0190760932 -0.0427036485 -0.0700439802 0.0377143990 [21] -0.0034790083 -0.0216293715 0.1409005611 -0.0410822990 0.0675187335 [26] -0.0512278990 0.0743145117 0.1165245152 -0.0991104561 -0.1153384786 [31] -0.0123101156 -0.0571664686 0.0002289783 -0.0508315505 -0.0596665756 [36] 0.0028932218 -0.0217492022 -0.0193418531 -0.0434271395 0.0599657764 [41] -0.0624635127 -0.0214588635 -0.0131607734 -0.0202103712 0.0548987056 [46] -0.0287164824 -0.0570019365 0.0212770718 > 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/3a4231244118270.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/4e0ak1244118270.tab") > > system("convert tmp/11nkf1244118270.ps tmp/11nkf1244118270.png") > system("convert tmp/27dff1244118270.ps tmp/27dff1244118270.png") > > > proc.time() user system elapsed 0.554 0.314 0.722