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 = '0' > 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/1mn3n1229879935.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/2iy441229879935.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.552069e-01 2.139414e-01 1.621142e-01 4.234026e-02 [6] 3.030153e-01 1.497611e-01 -8.158507e-04 1.757889e-01 -3.670007e-02 [11] 1.095153e-01 -1.692495e-01 -3.160272e-01 -8.771913e-02 -2.151450e-01 [16] -5.469974e-03 -1.803270e-01 -2.324178e-01 -1.236472e-01 -2.310117e-01 [21] -7.548577e-02 -1.539161e-02 -1.047542e-01 3.907338e-02 -1.671902e-01 [26] -6.954249e-02 2.584518e-02 -4.970384e-02 6.246775e-03 -1.062004e-02 [31] 2.171669e-02 8.124640e-02 -3.133975e-02 -4.309884e-02 -1.001051e-01 [36] -1.924482e-02 4.347860e-02 5.704122e-02 4.282458e-02 -1.386145e-02 [41] 3.162837e-02 2.325367e-02 -6.191547e-02 -3.389998e-03 7.647120e-03 [46] 6.722988e-05 4.737599e-02 2.504538e-02 > (mypacf <- c(rpacf$acf)) [1] 0.255206868 0.159178254 0.082949938 -0.046106523 0.290573435 [6] 0.022828012 -0.146867288 0.151421432 -0.085793843 0.032347667 [11] -0.319777212 -0.233614955 0.020919091 -0.127658956 0.109705566 [16] -0.171623854 0.103332231 -0.070991092 -0.053564735 0.115073127 [21] 0.099015785 0.101943528 -0.151112719 -0.136629292 -0.086440878 [26] 0.041966490 -0.010278975 -0.213469377 0.088596722 -0.055519508 [31] -0.002074142 -0.037976629 0.004506484 0.017935225 -0.109148009 [36] -0.042113205 0.096839299 0.100026345 -0.033016373 -0.031648616 [41] -0.005664129 -0.127423768 -0.040938186 -0.018500208 -0.057742091 [46] -0.039043952 -0.013339595 > 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/302us1229879935.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/4d46h1229879935.tab") > > system("convert tmp/1mn3n1229879935.ps tmp/1mn3n1229879935.png") > system("convert tmp/2iy441229879935.ps tmp/2iy441229879935.png") > > > proc.time() user system elapsed 0.609 0.310 0.704