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(2.64,2.75,2.7,2.87,3.03,3.14,3.02,2.86,3.07,2.93,2.83,2.72,2.73,2.72,2.77,2.61,2.47,2.3,2.38,2.43,2.39,2.6,2.84,2.87,2.92,3.08,3.33,3.48,3.57,3.66,3.77,3.75,3.75,3.81,3.82,3.89,4.05,4.1,4.07,4.26,4.4,4.61,4.63,4.48,4.46,4.45,4.32,4.52,4.21,3.97,4.12,4.5,4.73,5.26,5.2,4.94,4.95,4.52,3.85,3.41,2.95,2.68,2.53,2.44,2.16,2.2,2.1,2.29,2.03,2.05,1.94) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '2' > 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/1dyww1260628998.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/2de1e1260628998.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.370095196 -0.048805898 0.064690586 -0.009778939 [6] -0.178330295 0.245088953 -0.259297966 -0.073696318 0.085301501 [11] -0.011456273 0.042743089 0.037315417 -0.136911778 0.206924840 [16] -0.063791636 0.021665961 -0.028108856 0.074338119 -0.173857290 [21] 0.114948745 -0.075108189 0.031203588 0.005278891 -0.078808058 [26] 0.035860450 0.097581365 -0.063348870 0.030827566 0.012791485 [31] -0.068528876 0.063708085 0.001021204 -0.002121866 -0.022168615 [36] 0.022714998 -0.094197507 > (mypacf <- c(rpacf$acf)) [1] -0.3700951956 -0.2152607093 -0.0448671389 -0.0099280893 -0.2112891111 [6] 0.1061680709 -0.2037734025 -0.2645033050 -0.1635776304 -0.1423818811 [11] 0.0254822187 -0.0660831464 -0.1949882602 0.0806060125 -0.0931245379 [16] 0.0009915774 -0.0825487305 0.0583858088 -0.0501224468 -0.1004966771 [21] -0.0584412006 0.0070110727 0.0390608750 -0.1631348365 -0.0644905914 [26] 0.0488606568 -0.0175025132 -0.0421205701 -0.0433476787 -0.0284241562 [31] 0.0163342644 -0.1272886658 0.1025395595 0.0186371925 0.0686222604 [36] -0.1419075285 > 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/3r7r81260628998.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/4lb4b1260628998.tab") > > system("convert tmp/1dyww1260628998.ps tmp/1dyww1260628998.png") > system("convert tmp/2de1e1260628998.ps tmp/2de1e1260628998.png") > > > proc.time() user system elapsed 0.555 0.320 0.704