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(349,348,347,345,365,364,349,339,340,340,341,343,341,343,341,335,355,357,337,325,336,338,337,328,326,327,319,310,320,322,303,292,303,315,311,307,308,312,309,310,309,304,287,275,290,298,294,286,294,292,287,281,280,271,264,259,271,279,279,273,286,286,280,277,269,255,252,245,257,267,261,258,271,262,258,253,236,228,235,226,231,235,227,222,233,221,218,220,204,196,208,190,191,194,179,162,179,176,168,170,153,142,155,136,136,144,135,114,135,132,123,123,103,97,113,108,111,121,111,97) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '1' > par1 = '60' > #'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/1ff361281886413.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/2q62r1281886413.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.967131991 0.938193906 0.917314510 0.890750666 [6] 0.860337604 0.833856109 0.801069901 0.773243617 0.749943237 [11] 0.722433019 0.700658741 0.680082813 0.642341611 0.609610911 [16] 0.585159837 0.557084316 0.524289891 0.497302434 0.466723214 [21] 0.441613166 0.419549479 0.393861711 0.371625840 0.351814424 [26] 0.319737768 0.291518547 0.272661355 0.252807212 0.228775186 [31] 0.209749827 0.189002080 0.172935074 0.159613701 0.142197523 [36] 0.125856629 0.112660697 0.091545027 0.071518883 0.057178465 [41] 0.041323813 0.022047755 0.005772777 -0.010191065 -0.021370271 [46] -0.031239199 -0.042762590 -0.053725060 -0.061627474 -0.076312625 [51] -0.089658466 -0.098775663 -0.108794133 -0.123943250 -0.137052817 [56] -0.147916504 -0.154125014 -0.161057317 -0.169585290 -0.178402124 [61] -0.186322431 > (mypacf <- c(rpacf$acf)) [1] 0.9671319912 0.0440737158 0.1134769131 -0.0847084069 -0.0688837672 [6] 0.0195894760 -0.1162220842 0.0703366095 0.0385747913 -0.0460959801 [11] 0.0894496607 -0.0256409731 -0.2552236882 0.0224314437 0.0435298629 [16] 0.0051112532 -0.0619803540 0.0320331389 -0.0370637711 0.0452653737 [21] -0.0016798673 -0.0285836162 0.0215282871 -0.0122428353 -0.1314251715 [26] 0.0014120180 0.0514186661 0.0544372783 -0.0249953435 0.0064151576 [31] -0.0213058388 0.0201675926 0.0020455974 -0.0354969699 -0.0064507783 [36] -0.0028181943 -0.0503666526 -0.0265811506 -0.0180336504 0.0120573581 [41] -0.0096373542 -0.0230237341 0.0030107461 0.0288378950 -0.0038727431 [46] 0.0130345358 -0.0110044335 -0.0075668495 -0.0576878338 -0.0063508029 [51] -0.0119110443 0.0059090850 -0.0425251949 -0.0181704094 0.0190650184 [56] 0.0328085369 -0.0221584778 -0.0006358784 -0.0298842382 -0.0467825891 > 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/3bpjw1281886413.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/4kt7r1281886413.tab") > > try(system("convert tmp/1ff361281886413.ps tmp/1ff361281886413.png",intern=TRUE)) character(0) > try(system("convert tmp/2q62r1281886413.ps tmp/2q62r1281886413.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.616 0.323 0.863