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(333,332,331,329,349,348,333,323,324,324,325,327,329,333,329,333,355,358,338,326,320,322,322,324,326,330,331,333,364,363,341,327,313,321,312,312,312,314,312,319,356,351,329,313,298,303,278,275,276,276,273,287,320,313,281,266,258,259,237,231,237,236,229,243,271,262,227,208,212,222,200,193,204,203,190,209,240,234,210,195,202,204,180,169,178,181,163,174,194,187,160,143,151,154,141,127,134,138,120,129,151,152,124,99,104,109,96,87,94,89,63,76,100,104,80,55,60,71,62,61) > 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/1lonw1281956087.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/2lonw1281956087.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.00000000 0.20730748 -0.48390771 -0.19296799 0.25045701 0.01165491 [7] -0.42109940 -0.03141684 0.24271949 -0.15746382 -0.45403313 0.18888404 [13] 0.86923744 0.19126254 -0.42226878 -0.17872658 0.23215110 0.01683468 [19] -0.38494671 -0.06696413 0.21631078 -0.12804077 -0.40526162 0.16537553 [25] 0.73705438 0.17850252 -0.37086933 -0.17107277 0.21327107 0.02927086 [31] -0.33409178 -0.08953155 0.17753776 -0.11391774 -0.35950276 0.16037501 [37] 0.61501017 0.14759554 -0.31452179 -0.15690830 0.18304475 0.02753159 [43] -0.25648401 -0.06937729 0.14048118 -0.10392601 -0.29734298 0.15926905 [49] 0.47494923 > (mypacf <- c(rpacf$acf)) [1] 0.207307484 -0.550544518 0.115017612 0.025156726 -0.226159487 [6] -0.307586642 0.207707075 -0.302538143 -0.350533720 -0.372008119 [11] 0.306571668 0.617940971 -0.071561915 0.308785276 0.041604220 [16] -0.046611916 0.023532674 0.100441403 -0.151823269 0.048329063 [21] -0.004670925 -0.009385218 -0.045359386 -0.008064076 -0.046123684 [26] -0.069539932 -0.034677599 -0.028188215 -0.017332990 0.059468350 [31] -0.012488961 -0.034429697 -0.022374760 -0.044871368 0.053867350 [36] -0.111046471 -0.030832269 0.035944162 -0.079615606 -0.079114627 [41] 0.008900583 0.099216993 0.012026044 0.074045577 0.126851028 [46] 0.059008505 0.031542776 -0.066439654 > 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/3o6lk1281956087.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/4s72q1281956087.tab") > > try(system("convert tmp/1lonw1281956087.ps tmp/1lonw1281956087.png",intern=TRUE)) character(0) > try(system("convert tmp/2lonw1281956087.ps tmp/2lonw1281956087.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.574 0.310 0.759