R version 2.8.1 (2008-12-22) 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(4.2,4.19,4.19,4.19,4.19,4.18,4.2,4.19,4.17,4.21,4.22,4.23,4.21,4.23,4.23,4.22,4.25,4.28,4.3,4.32,4.33,4.32,4.34,4.33,4.31,4.31,4.3,4.3,4.29,4.33,4.32,4.32,4.35,4.37,4.39,4.4,4.41,4.44,4.47,4.47,4.47,4.48,4.47,4.48,4.46,4.44,4.43,4.41,4.41,4.38,4.35,4.37,4.4,4.39,4.36,4.34,4.33,4.33,4.34,4.34,4.35,4.37,4.39,4.4,4.38,4.37,4.36,4.33,4.33,4.33,4.32,4.33,4.34) > 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/rcomp/tmp/19fql1241720402.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/22a0v1241720402.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.233676069 0.047412944 0.174045689 0.078104327 [6] 0.031440897 -0.083628916 -0.053651859 -0.156813895 0.031764631 [11] 0.037926132 -0.023432002 -0.151296343 -0.094083411 -0.034970301 [16] -0.103549109 0.022070208 -0.135943614 0.014378009 0.168373307 [21] 0.200123863 0.019307913 0.027242913 0.210500943 0.046279875 [26] 0.023305323 -0.025131605 -0.085476311 -0.070067280 -0.036543226 [31] -0.091440757 -0.128983335 -0.080004504 -0.128568111 -0.031198097 [36] -0.077988205 -0.143020015 -0.125964164 -0.131710441 0.015824255 [41] -0.032739352 0.020799904 0.165674352 0.124458098 0.002927681 [46] -0.013586268 0.030958815 -0.053961518 -0.081496495 > (mypacf <- c(rpacf$acf)) [1] 0.233676069 -0.007606934 0.174180253 -0.001639199 0.014735140 [6] -0.131796893 -0.018696327 -0.168195525 0.157558101 0.007049566 [11] 0.046474669 -0.217782658 -0.018830601 -0.090159835 0.004571319 [16] 0.074439534 -0.102513904 0.091273595 0.113311323 0.154083438 [21] -0.116338312 0.048463973 0.086674606 0.003745909 -0.037992224 [26] -0.014115619 -0.101932332 -0.002372879 -0.084979695 -0.063515209 [31] 0.005161737 -0.021363214 -0.086355003 0.017561608 -0.025867926 [36] -0.084560041 -0.045322399 -0.152967586 0.033013869 -0.010665593 [41] 0.090446994 0.091958301 0.005481325 -0.149351825 -0.102691006 [46] -0.022958047 -0.001738875 -0.048417882 > 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/32oyr1241720402.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/4jm9n1241720402.tab") > > system("convert tmp/19fql1241720402.ps tmp/19fql1241720402.png") > system("convert tmp/22a0v1241720402.ps tmp/22a0v1241720402.png") > > > proc.time() user system elapsed 0.583 0.323 0.743