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(105.3,103,103.8,103.4,105.8,101.4,97,94.3,96.6,97.1,95.7,96.9,97.4,95.3,93.6,91.5,93.1,91.7,94.3,93.9,90.9,88.3,91.3,91.7,92.4,92,95.6,95.8,96.4,99,107,109.7,116.2,115.9,113.8,112.6,113.7,115.9,110.3,111.3,113.4,108.2,104.8,106,110.9,115,118.4,121.4,128.8,131.7,141.7,142.9,139.4,134.7,125,113.6,111.5,108.5,112.3,116.6,115.5,120.1,132.9,128.1,129.3,132.5,131,124.9,120.8,122,122.1,127.4,135.2,137.3,135,136,138.4,134.7,138.4,133.9,133.6,141.2,151.8,155.4,156.6,161.6,160.7,156,159.5,168.7,169.9,169.9,185.9,190.8,195.8,211.9) > par5 = '12' > par4 = '0' > par3 = '1' > par2 = '-1.5' > 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/1vob51228833547.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/2x0jb1228833547.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.000000e+00 2.946250e-01 6.720934e-02 6.957122e-02 4.047072e-02 [6] -2.387100e-01 -1.494441e-01 -1.320980e-01 -9.678816e-02 -2.061148e-01 [11] -9.951124e-03 -1.515592e-02 6.064534e-03 1.642391e-01 3.401669e-01 [16] -3.123542e-02 -3.895801e-02 -6.176010e-02 4.895309e-02 2.258101e-02 [21] 2.800391e-02 4.249700e-02 8.071923e-02 -1.348790e-01 -1.610149e-01 [26] -2.004685e-01 -7.248314e-02 -9.994445e-02 5.278003e-03 -1.014937e-01 [31] -4.160486e-02 -4.104773e-02 1.683944e-01 6.236994e-02 2.620504e-02 [36] 5.522237e-02 9.563455e-02 -9.653394e-02 -1.142013e-01 -2.946175e-02 [41] 2.065220e-02 -3.676673e-02 2.697601e-02 -3.107316e-02 -4.535548e-02 [46] -1.784007e-02 8.846603e-02 -1.451022e-02 6.162419e-02 8.513367e-02 [51] 1.032930e-01 -9.052438e-03 1.408433e-02 5.367215e-02 3.808377e-02 [56] -4.328522e-02 -3.288822e-02 -6.351492e-02 7.942019e-05 1.031618e-02 [61] 5.461396e-02 > (mypacf <- c(rpacf$acf)) [1] 0.294625008 -0.021457115 0.060986050 0.004563628 -0.278794222 [6] -0.003967811 -0.096187035 -0.009978180 -0.161344431 0.059564209 [11] -0.058721160 -0.004638888 0.188515427 0.186991096 -0.239365430 [16] -0.028780980 -0.125497953 0.158429775 0.195491689 -0.024753064 [21] 0.041900062 0.002770947 -0.139541233 -0.151381472 -0.127931260 [26] 0.039781634 -0.101515230 0.076080097 -0.081192746 -0.050423606 [31] -0.011095001 0.005032862 -0.108325120 -0.075920554 -0.011449166 [36] 0.055267903 0.062175999 -0.012034255 0.054952600 -0.100401168 [41] 0.016596128 -0.021038455 0.026769034 0.009258122 0.034519315 [46] 0.050306090 -0.016517443 0.106901537 -0.025481460 0.002908370 [51] -0.008792224 -0.030327584 0.043504048 -0.032103535 0.001023043 [56] -0.029678959 0.025915644 0.028627825 0.034832513 0.024286679 > 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/3qwwz1228833547.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/4qld81228833547.tab") > > system("convert tmp/1vob51228833547.ps tmp/1vob51228833547.png") > system("convert tmp/2x0jb1228833547.ps tmp/2x0jb1228833547.png") > > > proc.time() user system elapsed 0.585 0.328 1.088