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(100.00,110.08,123.28,106.30,114.60,110.22,117.82,138.84,131.13,153.26,148.76,110.75,132.00,138.55,126.50,119.47,152.49,152.46,134.08,162.33,130.46,142.83,148.39,122.88,125.86,133.31,140.97,110.30,123.04,125.99,112.24,136.10,111.86,109.63,135.75,114.39,121.79,101.33,147.01,113.01,101.89,117.85,128.68,117.27,121.55,109.18,127.88,104.92,100.93,116.79,107.50,109.18,128.31,83.80,93.16,103.99,106.33,97.55,111.71,105.43,103.62) > 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/1q8gf1261141067.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/2zvek1261141067.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.384520473 0.371872188 0.527502414 0.355104351 [6] 0.294684565 0.280496828 0.271967837 0.208865863 0.212473822 [11] 0.219261900 0.012176468 0.201325997 0.070399030 -0.001933103 [16] -0.017720720 -0.056294858 -0.009324176 -0.060764669 -0.103943254 [21] -0.065338494 -0.051451173 -0.069552824 -0.128233812 -0.055163717 [26] -0.069899662 -0.098192888 -0.086490161 -0.170029051 -0.115122645 [31] -0.115611674 -0.257316467 -0.183463211 -0.151910031 -0.242578305 [36] -0.237141584 -0.172932494 -0.228516166 -0.314631358 -0.159551106 [41] -0.180871019 -0.242055558 -0.082506093 -0.127498300 -0.145171426 [46] -0.075225321 -0.109819875 -0.075732830 -0.024887711 -0.019939359 [51] -0.005610558 -0.001821892 0.022385886 0.074590670 0.081050327 [56] 0.052952052 0.052516403 0.048333051 0.019506296 0.030656267 [61] 0.021604855 > (mypacf <- c(rpacf$acf)) [1] 0.384520473 0.262885372 0.404682482 0.076876517 -0.006500662 [6] -0.068754643 0.028385160 -0.007590445 0.048830528 0.046362526 [11] -0.236467818 0.131624888 -0.109047187 0.008904981 -0.171136739 [16] -0.064231921 0.057541281 0.055361438 -0.038511557 -0.021059722 [21] 0.060987971 -0.032161479 0.023153914 -0.026544498 0.038522803 [26] -0.034457052 -0.019058451 -0.140244207 -0.024071609 -0.047429598 [31] -0.178255816 -0.004141793 -0.008217307 -0.056023881 -0.058602613 [36] 0.050712377 -0.045192314 -0.143079016 0.068566938 0.123561327 [41] 0.055457378 0.066758886 0.011713732 -0.007363829 -0.026317311 [46] -0.112432935 0.011542248 0.073965078 -0.026956286 0.029353417 [51] -0.081574471 -0.050298520 0.068774976 0.015902221 0.042592940 [56] -0.039064408 -0.105375075 -0.020272315 0.042626139 -0.046019535 > 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/3brpi1261141067.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/4k6di1261141067.tab") > > try(system("convert tmp/1q8gf1261141067.ps tmp/1q8gf1261141067.png",intern=TRUE)) character(0) > try(system("convert tmp/2zvek1261141067.ps tmp/2zvek1261141067.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.606 0.315 0.802