R version 2.12.0 (2010-10-15) Copyright (C) 2010 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-pc-linux-gnu (32-bit) 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(493,514,522,490,484,506,501,462,465,454,464,427,460,473,465,422,415,413,420,363,376,380,384,346,389,407,393,346,348,353,364,305,307,312,312,286,324,336,327,302,299,311,315,264,278,278,287,279,324,354,354,360,363,385,412,370,389,395,417,404) > par20 = '' > par19 = '' > par18 = '' > par17 = '' > par16 = '' > par15 = '' > par14 = '' > par13 = '' > par12 = '' > par11 = '' > par10 = '' > par9 = '' > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '1' > par3 = '1' > par2 = '1' > par1 = '48' > ylab = '' > xlab = '' > main = '' > #'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/1k0g11292015520.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/rcomp/tmp/2k0g11292015520.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.104329884 0.259034078 0.270825407 0.250402830 [6] 0.187695989 0.034220874 0.018321522 0.101257983 0.011591828 [11] 0.105510047 -0.002927862 -0.005246292 -0.030627161 0.013404326 [16] 0.065484600 -0.067200938 -0.009536020 0.023007378 0.086909544 [21] -0.087797718 -0.035968734 -0.140491016 0.154399358 -0.169409260 [26] -0.061021226 0.033122028 -0.036857227 -0.015190569 -0.038193558 [31] -0.065584749 -0.037182013 -0.230859810 -0.019600317 -0.198737037 [36] -0.180929747 -0.146053475 -0.173050853 -0.136775608 -0.131956645 [41] -0.062417327 -0.123972735 0.009356790 -0.030257607 -0.017011046 [46] 0.009235095 0.016746988 > (mypacf <- c(rpacf$acf)) [1] 0.104329884 0.250880115 0.242114520 0.183767299 0.073709278 [6] -0.140596141 -0.172549941 0.005758627 0.018061546 0.168990636 [11] 0.046903829 -0.069137293 -0.160083357 -0.062944389 0.121707385 [16] 0.047916893 0.051245763 -0.005609290 0.042238840 -0.170508588 [21] -0.095336916 -0.184162788 0.276979923 0.014648527 0.011254433 [26] 0.051469939 -0.099294979 -0.101325362 -0.078285265 0.016967441 [31] 0.025958002 -0.154754027 -0.052188252 -0.165169169 -0.088235185 [36] 0.010557272 0.035955077 -0.032039848 0.100596011 0.097916701 [41] -0.098082901 0.013796573 0.038813559 -0.026448477 0.018567545 [46] -0.037374444 > 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/3oiep1292015520.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/49jvd1292015520.tab") > > try(system("convert tmp/1k0g11292015520.ps tmp/1k0g11292015520.png",intern=TRUE)) character(0) > try(system("convert tmp/2k0g11292015520.ps tmp/2k0g11292015520.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.680 0.200 0.848