R version 2.11.1 (2010-05-31) Copyright (C) 2010 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(75,74,73,71,91,90,75,65,66,66,67,69,75,79,75,77,100,100,94,83,83,83,84,88,89,98,94,84,111,98,98,83,79,78,80,94,98,104,94,90,115,104,114,99,96,98,104,111,117,125,117,118,151,145,155,133,124,125,131,133,136,141,130,137,177,183,191,166,156,153,164,164,168,173,164,165,205,207,215,190,169,175,188,188,196,201,194,197,237,236,244,222,195,199,207,204,212,222,214,217,258,256,251,223,198,206,214,212,227,238,228,235,275,278,278,251,225,232,238,239) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '1' > par1 = '48' > #'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/rcomp/tmp/1gzug1281876839.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/rcomp/tmp/2gzug1281876839.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.960419958 0.916720863 0.880867881 0.858134780 [6] 0.844679294 0.823729155 0.792245685 0.759090606 0.743508407 [11] 0.739550156 0.740083343 0.739843230 0.701514058 0.660809587 [16] 0.626084889 0.605086618 0.593473680 0.573522189 0.543293555 [21] 0.510458876 0.493168501 0.485142413 0.480460315 0.475225971 [26] 0.436415924 0.397163991 0.363290462 0.339119692 0.322981061 [31] 0.296813104 0.264515582 0.229393385 0.206732978 0.192597921 [36] 0.182254027 0.172837630 0.136901932 0.099950073 0.067766547 [41] 0.045309570 0.030264419 0.004203629 -0.024652759 -0.054178032 [46] -0.072692183 -0.083775234 -0.091545794 -0.098287859 > (mypacf <- c(rpacf$acf)) [1] 9.604200e-01 -7.327458e-02 8.152162e-02 1.407517e-01 1.033072e-01 [6] -8.701421e-02 -9.884734e-02 -1.017145e-02 1.913781e-01 8.444416e-02 [11] 6.288761e-02 7.721643e-02 -4.409031e-01 -1.215884e-02 -3.896255e-02 [16] 6.162503e-02 8.961426e-02 -1.795110e-02 -1.484062e-02 -2.057499e-02 [21] 9.815105e-04 -1.944765e-02 1.562492e-02 4.201208e-02 -2.317635e-01 [26] 1.363331e-02 -3.496410e-02 -4.561923e-02 3.233358e-02 -6.442860e-02 [31] 5.444374e-02 -3.340784e-02 -6.515493e-02 -1.538370e-03 3.792766e-03 [36] 1.763912e-02 -9.350460e-02 -3.032370e-02 -7.922991e-03 -2.234038e-02 [41] -6.177160e-03 -5.935716e-02 6.791210e-02 1.225712e-02 -5.348962e-02 [46] 7.005519e-03 -5.716862e-06 -5.970842e-03 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/rcomp/tmp/3ur971281876839.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/rcomp/tmp/4y98c1281876839.tab") > > try(system("convert tmp/1gzug1281876839.ps tmp/1gzug1281876839.png",intern=TRUE)) character(0) > try(system("convert tmp/2gzug1281876839.ps tmp/2gzug1281876839.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.780 0.410 1.202