R version 2.9.0 (2009-04-17) Copyright (C) 2009 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(65.4,72.2,80.4,77.7,76.5,100.1,73.5,77.3,98.6,112.4,77.3,139.3,75.4,64.2,86.8,79.1,71.7,100,82.1,74.8,92.3,83.3,83.7,148,71.4,71.2,84.6,80.9,80.6,105.5,79.2,78.4,92.6,88.3,98.2,157.4,73.9,80.9,93,84.9,96.2,106.5,81.7,82.9,96,92.6,116.5,155,95.1,86.2,105,89.7,97.1,120.8,92.2,98.8,104.1,106.5,113.4,192.4,103.6,97.6,99.9,106.4,104.8,114.1,93,90.2,108.8,108.7,125.2,180.4,91.6,87.1,98.3) > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '1' > 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: > 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 (par6 == 'White Noise') par6 <- 'white' else par6 <- 'ma' > par7 <- as.numeric(par7) > 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/1fwuv1261057785.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > racf <- acf(x, par1, main='Autocorrelation', xlab='time lag', ylab='ACF', ci.type=par6, ci=par7, sub=paste('(lambda=',par2,', d=',par3,', D=',par4,', CI=', par7, ', CI type=',par6,')',sep='')) > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/2yye41261057785.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 1.607242e-01 3.050759e-02 1.838529e-01 -4.371906e-02 [6] 2.430368e-05 4.261085e-01 -1.262164e-02 -6.668519e-02 1.345422e-01 [11] -4.001875e-02 1.122841e-01 7.504255e-01 8.102404e-02 1.047849e-03 [16] 1.203163e-01 -9.147334e-02 -3.040075e-02 2.932111e-01 -7.909203e-02 [21] -1.000039e-01 4.171520e-02 -1.328360e-01 -3.286890e-04 5.066219e-01 [26] 7.196733e-04 -4.325390e-02 1.220322e-02 -1.540395e-01 -8.482116e-02 [31] 1.575048e-01 -1.349882e-01 -1.437804e-01 -6.137546e-02 -1.925314e-01 [36] -8.423285e-02 3.283197e-01 > (mypacf <- c(rpacf$acf)) [1] 0.160724170 0.004799310 0.182931439 -0.107929544 0.025862421 [6] 0.416204647 -0.165763320 -0.064276048 0.053641321 0.011595584 [11] 0.187142209 0.665640162 -0.190366363 -0.083996146 -0.131324915 [16] -0.038912467 -0.029120501 -0.202193983 -0.007316885 0.029149410 [21] -0.049031398 -0.052298742 -0.148861045 0.017670579 0.040957812 [26] -0.025122262 -0.110228707 -0.023673220 0.020394938 -0.031491120 [31] -0.043897775 -0.058731176 -0.023674952 0.050443047 -0.040931752 [36] 0.009042052 > 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/3fcke1261057785.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/4f6pk1261057785.tab") > > try(system("convert tmp/1fwuv1261057785.ps tmp/1fwuv1261057785.png",intern=TRUE)) character(0) > try(system("convert tmp/2yye41261057785.ps tmp/2yye41261057785.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.581 0.344 0.755