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(31.48,29.90,33.84,39.12,33.70,25.09,51.44,45.59,52.52,48.56,41.75,49.59,32.75,33.38,35.65,37.03,35.68,20.97,58.55,54.96,65.54,51.57,51.15,46.64,35.70,33.25,35.19,41.67,34.87,21.21,56.13,49.23,59.72,48.10,47.47,50.50,40.06,34.15,36.86,46.36,36.58,23.87,57.28,56.39,57.66,62.30,48.93,51.17,39.64,33.21,38.13,43.29,30.60,21.96,48.03,46.15,50.74,48.11,38.39,44.11) > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '1' > par3 = '1' > par2 = '1' > par1 = '36' > #'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/17jkf1261325540.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/2xfpb1261325540.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.592026740 0.310497185 -0.138969416 -0.019410768 [6] -0.095080873 0.127266907 -0.107018307 0.134224294 -0.050612237 [11] -0.002122072 0.077194689 -0.228194781 0.028114660 0.003416604 [16] -0.010631660 0.053829278 0.025676476 0.001506161 -0.023995736 [21] -0.091493199 0.213854508 -0.344694725 0.339266471 -0.195401709 [26] 0.141786820 -0.021979392 0.113693580 -0.212614934 0.160072953 [31] -0.141532345 0.080367996 0.031733099 -0.075700763 0.079954291 [36] -0.060809037 -0.030978327 > (mypacf <- c(rpacf$acf)) [1] -0.592026740 -0.061583078 0.030469092 -0.116447268 -0.265814338 [6] -0.022781438 0.006741176 0.053536641 0.037376285 -0.034142890 [11] 0.118456901 -0.184660226 -0.343192251 -0.162712855 -0.008308252 [16] -0.030026872 -0.113906037 -0.002522778 0.023320257 -0.181645603 [21] 0.191823942 -0.189985493 -0.004077640 -0.036405635 -0.109703133 [26] 0.014875980 0.200651064 -0.021617687 -0.113918644 0.080297920 [31] 0.055148666 -0.015293464 0.005573189 -0.088422622 -0.066215363 [36] -0.027481843 > 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/3ooin1261325540.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/41rdz1261325540.tab") > > try(system("convert tmp/17jkf1261325540.ps tmp/17jkf1261325540.png",intern=TRUE)) character(0) > try(system("convert tmp/2xfpb1261325540.ps tmp/2xfpb1261325540.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.547 0.303 0.649