R version 2.11.1 (2010-05-31) Copyright (C) 2010 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(430,429,428,426,424,423,424,426,427,427,428,430,432,435,426,411,405,403,402,399,392,387,380,379,386,385,365,356,338,338,343,338,320,316,317,315,317,321,303,303,290,285,300,291,278,273,277,269,275,278,255,254,245,240,261,247,229,213,218,206,217,219,196,193,188,171,190,180,149,135,151,134,145,151,137,124,125,109,131,133,103,85,104,82) > 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/rcomp/tmp/1uvuy1281970486.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/rcomp/tmp/2hj4c1281970486.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.0000000000 -0.1565408984 -0.3109566937 0.0976226733 -0.1384995870 [6] -0.1141963915 0.5225087990 -0.0371307849 -0.2621718054 0.0714245455 [11] -0.1763023731 -0.2185543107 0.6981700759 -0.0401606960 -0.3335241422 [16] 0.0315849001 -0.0612669741 -0.1050383966 0.3640084931 0.0404656824 [21] -0.2933653832 0.0263887862 -0.1022163150 -0.1481454786 0.4275542650 [26] 0.0494961542 -0.2712337357 -0.0177711768 -0.0003775883 -0.0294618651 [31] 0.2237166214 0.0662304269 -0.2284820609 0.0403457909 -0.0726619242 [36] -0.0541779814 0.2572401752 0.0808758610 -0.2156933721 -0.0246227751 [41] 0.0255866113 0.0212843240 0.1229845463 0.0672119730 -0.1686250062 [46] 0.0019778748 -0.0694464814 -0.0025058372 0.1100544111 > (mypacf <- c(rpacf$acf)) [1] -0.1565408984 -0.3438887588 -0.0251438277 -0.2671433213 -0.2130905660 [6] 0.4100613479 0.0929032456 0.0394165872 0.0277596137 -0.2115756282 [11] -0.3283120721 0.4711199170 0.0158857727 0.0651383338 -0.0763975553 [16] -0.0501232635 0.0889638114 -0.1777174297 0.0031415682 -0.0820980472 [21] -0.0215064194 -0.0957184278 0.0588320370 -0.0991057384 0.0382576546 [26] 0.0367659986 0.0062404845 0.0870633275 0.0385229789 0.0110005507 [31] -0.0566040235 -0.0008802539 0.0755007423 -0.0267361309 0.0443804117 [36] -0.0002427088 0.0700470956 -0.0430510756 0.0230433085 0.0291999146 [41] 0.0275434912 -0.0202468384 0.0214584261 0.0355797100 -0.0905143753 [46] -0.0424518658 -0.0521868048 -0.0853195255 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/rcomp/tmp/332201281970486.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/rcomp/tmp/46k161281970486.tab") > > try(system("convert tmp/1uvuy1281970486.ps tmp/1uvuy1281970486.png",intern=TRUE)) character(0) > try(system("convert tmp/2hj4c1281970486.ps tmp/2hj4c1281970486.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.83 0.48 1.28