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(72.5,72.0,98.8,75.2,81.2,88.0,54.6,68.6,101.5,93.4,84.5,91.4,64.5,64.5,117.3,73.5,79.7,102.6,57.9,73.1,102.4,82.3,89.1,84.7,81.4,67.5,113.9,83.8,73.9,103.9,67.9,62.5,125.4,79.1,106.3,96.2,94.3,85.6,117.4,88.5,124.2,119.3,76.8,70.6,122.1,109.5,119.9,102.3,79.6,78.2,103.6,77.8,99.1,105.7,84.1,88.7,108.0,98.1,101.0,82.0) > par5 = '12' > par4 = '1' > par3 = '1' > par2 = '-1.6' > 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/18u491229685380.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/2wah71229685380.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 -5.452043e-01 5.490461e-02 1.839961e-01 -3.327609e-01 [6] 2.811669e-01 -7.973452e-02 -1.574841e-01 2.674217e-01 -4.139150e-01 [11] 4.864390e-01 -2.172271e-01 -1.222205e-01 3.445440e-01 -4.127255e-01 [16] 2.418702e-01 3.478627e-02 -2.072925e-01 2.438879e-01 -1.584625e-01 [21] 3.803739e-02 8.178614e-02 -1.212156e-01 1.883523e-01 -2.466784e-01 [26] 1.159969e-01 3.166398e-02 -9.614419e-02 1.008675e-01 -6.207744e-02 [31] -2.887757e-02 1.283890e-01 -9.815731e-02 4.487936e-02 -9.244022e-02 [36] 4.951814e-03 2.646731e-02 7.112067e-03 1.634291e-02 -2.704175e-02 [41] 1.479489e-02 5.136588e-02 -5.833630e-02 -4.994601e-05 1.670956e-03 [46] -1.319358e-02 -4.555416e-04 > (mypacf <- c(rpacf$acf)) [1] -0.545204311 -0.344848601 0.058529204 -0.248075935 -0.018457578 [6] 0.033081997 -0.149056007 0.028008477 -0.367648191 0.256585024 [11] 0.038335814 -0.052770174 0.128859261 -0.132508617 0.016560428 [16] -0.074004742 0.128943333 -0.051269558 0.179053250 -0.061075925 [21] -0.034404558 0.197785450 -0.020509290 0.029125908 -0.073490312 [26] -0.016105885 0.051889306 -0.070485537 -0.011540459 -0.020061289 [31] 0.114498722 -0.049288640 -0.029488744 -0.091597735 -0.201111189 [36] -0.068636006 -0.060673359 0.013637696 -0.013231578 -0.011067265 [41] 0.033430645 -0.071051861 -0.051986170 -0.045785025 0.068263929 [46] 0.002174052 > 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/3qemy1229685380.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/4v3xf1229685380.tab") > > system("convert tmp/18u491229685380.ps tmp/18u491229685380.png") > system("convert tmp/2wah71229685380.ps tmp/2wah71229685380.png") > > > proc.time() user system elapsed 0.572 0.294 0.798