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(77.33,75.28,77.43,73.25,68.41,72.87,65.61,69.04,57.84,51.07,47.48,44.01,45.29,43.8,55.48,75.73,101.42,116.07,135.81,132.69,124.05,109.65,102.79,94.09,92.23,90.6,92.6,81.71,76.36,71.44,75.26,70.3,67.68,67.65,61.92,58.34,55.04,62.5,59.44,60.03,64.24,74.33,74.41,69.75,72.03,68.18,63.01,61.71,63.52) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '0' > 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/1axc21292947151.ps",horizontal=F,onefile=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/2axc21292947151.ps",horizontal=F,onefile=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.927483909 0.776473779 0.567554461 0.351036590 [6] 0.146287154 -0.017997152 -0.132451805 -0.216330713 -0.278413433 [11] -0.314602195 -0.328885158 -0.337370034 -0.336921084 -0.324646270 [16] -0.305112358 -0.285808654 -0.260881309 -0.227113611 -0.185206231 [21] -0.146889117 -0.094900577 -0.043060358 0.007175349 0.033031727 [26] 0.042584089 0.031106780 0.007074850 -0.011225075 -0.015402786 [31] -0.001231791 0.019238296 0.042278657 0.060586591 0.070365583 [36] 0.068510246 0.059168313 0.050512302 0.037724460 0.028161410 [41] 0.017769684 0.011114018 0.009463100 0.004411803 0.002539078 [46] -0.001563463 -0.002789542 -0.001616208 -0.001233309 > (mypacf <- c(rpacf$acf)) [1] 0.927483909 -0.599202024 -0.316866696 0.138979044 -0.042221696 [6] 0.048663138 0.047494486 -0.299677297 -0.118389574 0.196359993 [11] -0.037023938 -0.259648489 0.040662226 0.020061306 -0.152128884 [16] -0.003569335 0.044812412 -0.132861964 0.045251141 -0.049926312 [21] 0.078727320 -0.108628955 -0.026225867 -0.202213405 -0.055564944 [26] 0.011526703 0.039378293 0.109820239 -0.118450947 -0.096014377 [31] 0.020179482 -0.060070782 -0.025011545 0.055930522 -0.097220623 [36] -0.137077924 0.172199046 -0.106961607 -0.043461485 -0.002999862 [41] -0.037803817 -0.002818941 -0.034411170 -0.059853414 -0.016301830 [46] 0.001379395 0.005056701 -0.056922742 > 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/36pab1292947151.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/4hz9e1292947151.tab") > > try(system("convert tmp/1axc21292947151.ps tmp/1axc21292947151.png",intern=TRUE)) character(0) > try(system("convert tmp/2axc21292947151.ps tmp/2axc21292947151.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.571 0.319 1.287