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(104.0,99.0,105.4,107.1,110.7,117.1,118.7,126.5,127.5,134.6,131.8,135.9,142.7,141.7,153.4,145.0,137.7,148.3,152.2,169.4,168.6,161.1,174.1,179.0,190.6,190.0,181.6,174.8,180.5,196.8,193.8,197.0,216.3,221.4,217.9,229.7,227.4,204.2,196.6,198.8,207.5,190.7,201.6,210.5,223.5,223.8,231.2,244.0,234.7,250.2,265.7,287.6,283.3,295.4,312.3,333.8,347.7,383.2,407.1,413.6,362.7,321.9,239.4,191.0,159.7,163.4,157.6,166.2,176.7,198.3,226.2,216.2,235.9) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '1' > 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/html/rcomp/tmp/122cg1259794091.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/2zn5f1259794091.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.642080e-01 4.076684e-01 1.152833e-01 -2.718343e-02 [6] -2.535293e-01 -3.155993e-01 -2.542069e-01 -2.520416e-01 -2.378490e-01 [11] -1.301650e-01 -1.706082e-02 -6.032867e-02 -8.241269e-02 2.584313e-03 [16] 5.279551e-02 -5.549929e-02 -7.343534e-02 -5.335038e-02 -2.057004e-02 [21] -6.859772e-02 4.512060e-02 5.455803e-02 1.207691e-01 6.544173e-02 [26] 1.637381e-01 1.293786e-01 3.081194e-02 -2.879702e-02 -5.855838e-02 [31] -4.332473e-02 -1.168465e-01 -5.906239e-02 -3.081754e-02 8.632432e-05 [36] 4.166680e-02 4.249645e-02 5.738271e-02 -8.265922e-03 -1.713189e-02 [41] 4.996257e-03 -1.226245e-02 -4.236047e-02 -6.443300e-02 -2.203234e-02 [46] 2.420997e-03 2.826243e-02 3.682717e-02 1.504764e-02 > (mypacf <- c(rpacf$acf)) [1] 0.564208037 0.131057298 -0.236619178 -0.086165162 -0.229521704 [6] -0.092095924 0.112635244 -0.121088330 -0.152083938 0.056264415 [11] 0.036122517 -0.198949495 -0.127862988 0.097369999 0.043063407 [16] -0.234715348 -0.120432250 -0.004873513 0.049253414 -0.081486288 [21] 0.010683887 -0.109564480 0.115457866 -0.012682579 -0.022441217 [26] -0.039485994 -0.058837635 0.006405085 -0.075223353 0.023753649 [31] -0.025636342 0.011453723 -0.009393813 -0.015925083 0.087895309 [36] -0.097735061 -0.020059771 -0.009059403 0.021473833 0.019089110 [41] -0.033925126 -0.050029336 -0.002647965 0.026409637 0.047342152 [46] -0.026445629 -0.030572913 -0.053410795 > 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/3nh7u1259794091.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/4bggf1259794091.tab") > > system("convert tmp/122cg1259794091.ps tmp/122cg1259794091.png") > system("convert tmp/2zn5f1259794091.ps tmp/2zn5f1259794091.png") > > > proc.time() user system elapsed 0.557 0.303 0.683