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(89.8,103.3,107.9,101,94.6,94.2,92.3,107.1,102.6,103.1,104.1,92.7,87,109.3,113.9,103.3,100.8,97.4,98.9,110.8,103.5,99.8,104.9,95.2,85.7,110,113.7,101.1,103.6,96.2,98.3,119.7,109.4,103.5,118.2,98.7,96.8,121.8,124,119.6,122.5,109.7,111.6,131.2,124.4,116.9,131.8,107.4,111,134,126.2,131.2,130.1,123.1,126.3,148.6,130.1,142.3,154.4,121.6,124.8,143.6,146.9,144.6,137.1,134.7,130.8,153.5,137.6,146.5,156.7,137.6,131.4,147.4,158.5,151.5,142.5,131.3,133.4,136.9,143.2,136.4,145.9,138.8,122.9) > par5 = '12' > par4 = '1' > par3 = '1' > par2 = '1.0' > par1 = '36' > #'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/13i2a1228260257.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/2mm4p1228260257.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.563465634 0.046070608 0.188927589 -0.158923566 [6] 0.065991870 0.067557374 -0.096561747 -0.136722037 0.316909072 [11] -0.212020968 -0.014064372 0.060472910 -0.060292928 0.101618370 [16] -0.036555108 -0.052325336 0.005620974 0.201966403 -0.202181962 [21] 0.050502586 0.120380950 -0.282547763 0.390417107 -0.291246574 [26] 0.012695228 0.174642811 -0.084665959 -0.094630738 0.146876222 [31] -0.125449925 0.023153724 0.139122667 -0.216775169 0.072559594 [36] 0.087515242 -0.112162265 > (mypacf <- c(rpacf$acf)) [1] -0.563465634 -0.397685472 0.001963737 0.015795030 0.039775035 [6] 0.125651405 0.059398788 -0.316613584 0.024056846 0.084563580 [11] -0.004983768 -0.139516903 -0.076014033 0.112735627 0.082557245 [16] -0.017647222 -0.027922901 0.233540271 0.068016550 -0.075548042 [21] 0.143101803 -0.166609280 0.114569288 -0.068969589 -0.012686749 [26] 0.156456614 0.096964631 -0.124175598 0.034396541 -0.087573277 [31] 0.039764437 -0.040147162 -0.058588028 -0.036107957 -0.017728499 [36] -0.141195783 > 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/33qs61228260257.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/4fbyl1228260258.tab") > > system("convert tmp/13i2a1228260257.ps tmp/13i2a1228260257.png") > system("convert tmp/2mm4p1228260257.ps tmp/2mm4p1228260257.png") > > > proc.time() user system elapsed 0.548 0.308 0.653