R version 2.7.0 (2008-04-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(29.59,30.7,30.52,32.67,33.19,37.13,35.54,37.75,41.84,42.94,49.14,44.61,40.22,44.23,45.85,53.38,53.26,51.8,55.3,57.81,63.96,63.77,59.15,56.12,57.42,63.52,61.71,63.01,68.18,72.03,69.75,74.41,74.33,64.24,60.03,59.44,62.5,55.04,58.34,61.92,67.65,67.68,70.3,75.26,71.44,76.36,81.71,92.6,90.6,92.23,94.09,102.79,109.65,124.05,132.69,135.81,116.07,101.42,75.73,55.48) > par5 = '12' > par4 = '0' > par3 = '1' > 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/11q0r1229698550.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/26njx1229698550.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.519831935 0.273123210 0.002689354 -0.129668212 [6] -0.222123759 -0.187114515 -0.048768074 -0.053155591 -0.105704971 [11] -0.036572936 -0.001475309 -0.097347327 -0.107290361 -0.045489787 [16] 0.029587479 -0.103434959 -0.118166932 -0.109121501 -0.086354741 [21] -0.078396150 0.047444202 0.120604694 0.097143401 0.101589395 [26] 0.126280361 0.125517108 -0.017230635 -0.040705081 -0.060447141 [31] -0.069829569 -0.073146879 0.009430583 0.035383705 0.020114251 [36] 0.075459323 0.047379531 0.042198967 -0.025129832 -0.032223374 [41] -0.015713177 -0.060689451 -0.024185792 -0.070298491 -0.011476861 [46] 0.040549280 0.031888562 0.050417906 -0.027070149 -0.066494140 [51] -0.020128923 -0.051527585 -0.009908729 -0.027612422 -0.029197090 [56] -0.017159953 -0.009957659 -0.001605785 -0.004709402 > (mypacf <- c(rpacf$acf)) [1] 5.198319e-01 3.971046e-03 -1.929246e-01 -8.417468e-02 -1.043073e-01 [6] -2.374804e-03 1.111228e-01 -1.211834e-01 -1.578908e-01 9.395238e-02 [11] 2.540346e-02 -1.928190e-01 -3.477161e-02 5.025726e-02 5.344178e-02 [16] -2.300132e-01 -1.124623e-01 -1.174976e-02 4.016804e-02 -5.107741e-02 [21] -7.389555e-06 -6.648743e-03 1.634190e-02 6.777069e-02 -1.403703e-02 [26] 1.366344e-02 -7.653238e-02 -1.052161e-03 -4.120652e-02 -3.281076e-02 [31] 1.479023e-02 3.940525e-02 -3.071692e-02 -1.801383e-02 1.250659e-01 [36] -1.016638e-01 1.982743e-02 3.249330e-02 -2.558103e-02 2.359461e-02 [41] -5.857599e-02 6.351154e-02 -1.116954e-01 1.020754e-01 8.048225e-02 [46] -1.115968e-01 -2.502327e-02 -4.176914e-02 -1.374947e-02 7.377120e-02 [51] -6.074081e-02 -3.598562e-02 1.396013e-02 -1.664991e-02 -2.412071e-03 [56] -2.090344e-02 -7.009318e-02 4.061098e-02 > 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/3vi551229698550.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/4l8nw1229698550.tab") > > system("convert tmp/11q0r1229698550.ps tmp/11q0r1229698550.png") > system("convert tmp/26njx1229698550.ps tmp/26njx1229698550.png") > > > proc.time() user system elapsed 1.556 0.542 1.638