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(95,94,93,91,111,110,95,85,86,86,87,89,93,96,99,92,109,110,97,88,93,93,89,89,91,97,99,85,101,105,88,80,87,84,87,87,85,96,102,93,111,117,101,88,98,89,93,93,95,105,109,94,113,125,106,95,109,100,94,94,94,103,103,80,106,117,99,95,116,118,100,100,105,121,131,108,136,149,131,137,164,169,154,160,166,186,197,166,191,207,187,191,222,230,210,224,234,251,258,227,254,281,261,264,286,293,276,292,299,319,329,293,318,346,327,329,353,355,332,346) > 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/1hma21280842867.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/2hma21280842867.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.18873397 -0.56198226 0.32202746 0.27745342 -0.12638834 [7] -0.12573208 -0.05240420 0.21241027 0.27832465 -0.46987531 -0.19774417 [13] 0.84034588 -0.14729660 -0.51577551 0.27938797 0.27436599 -0.12320483 [19] -0.12291699 -0.06471452 0.17178250 0.24513719 -0.39390597 -0.19253465 [25] 0.69078348 -0.11932776 -0.47526862 0.25327447 0.25210113 -0.14275801 [31] -0.10428108 -0.04525366 0.11598928 0.19218972 -0.31013626 -0.17091057 [37] 0.53832555 -0.08266951 -0.41316722 0.19906431 0.21673688 -0.14292204 [43] -0.09887864 -0.02890597 0.09220928 0.14633152 -0.25923328 -0.15375743 [49] 0.41219457 > (mypacf <- c(rpacf$acf)) [1] -0.188733972 -0.619675942 0.056025371 0.061913690 0.312545634 [6] 0.116343481 -0.160624656 0.028111565 0.399270132 -0.198288863 [11] -0.234465807 0.625873951 0.007237203 0.325132988 -0.131281895 [16] -0.040901444 0.052381744 -0.015143515 -0.156168044 -0.044650050 [21] -0.181342125 0.081601061 0.036104973 -0.042630335 -0.025226891 [26] -0.098367642 0.069592519 0.010957194 -0.074092430 -0.018249555 [31] 0.025361638 -0.041193616 -0.008137961 -0.051997846 0.050514308 [36] -0.042222367 0.063885194 -0.023180919 -0.062502603 -0.035381285 [41] -0.039789446 -0.068538894 0.006684374 -0.011438336 0.041234135 [46] 0.010303084 -0.062198829 -0.062782906 > 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/3vdpb1280842867.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/4on7e1280842867.tab") > > try(system("convert tmp/1hma21280842867.ps tmp/1hma21280842867.png",intern=TRUE)) character(0) > try(system("convert tmp/2hma21280842867.ps tmp/2hma21280842867.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.554 0.306 2.442