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(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 = '2' > 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/1e0uk1292947287.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/2e0uk1292947287.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.336626833 0.229006853 -0.228346931 0.108436133 [6] -0.236135949 -0.160876402 0.067125777 0.062888100 -0.053290850 [11] -0.099720876 0.217534818 -0.092624395 0.007378923 -0.027236441 [16] 0.140506289 -0.077042620 -0.010664961 -0.091994611 0.181252205 [21] -0.224627430 0.101208872 -0.116311486 0.198992163 -0.096310958 [26] 0.091121547 0.090984968 -0.094639213 0.013520871 -0.124017344 [31] 0.102601183 -0.131839263 0.090217827 -0.072190990 0.060102987 [36] 0.020912477 -0.024140476 0.044615275 -0.058734468 0.062897219 [41] -0.022332059 -0.031118209 0.025081756 0.003125142 -0.011865889 [46] -0.001401882 0.004579150 > (mypacf <- c(rpacf$acf)) [1] -0.3366268326 0.1304742616 -0.1346900093 -0.0240491935 -0.1875347196 [6] -0.3742754218 -0.0460950580 0.0913872123 -0.1376874721 -0.2937185143 [11] 0.0360153946 -0.0694528911 -0.1308284460 -0.0217131091 -0.0243436914 [16] -0.1058347256 0.0008966641 -0.1829081431 0.0133839104 -0.1123989938 [21] -0.0676538784 -0.2069315756 -0.0137956619 0.0166538292 -0.0223620166 [26] 0.0863206347 -0.1658667850 -0.0695906648 0.0291109303 -0.0356583449 [31] -0.0543866268 0.0181204168 -0.0821039230 -0.1710746024 0.1530385911 [36] -0.0282832549 -0.1152712421 -0.0501936341 -0.0270777077 -0.0374419230 [41] 0.0059154000 -0.0464944323 -0.0670653585 -0.0159884986 0.0200919811 [46] -0.0511191436 > 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/3hiaq1292947287.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/4kj9w1292947287.tab") > > try(system("convert tmp/1e0uk1292947287.ps tmp/1e0uk1292947287.png",intern=TRUE)) character(0) > try(system("convert tmp/2e0uk1292947287.ps tmp/2e0uk1292947287.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.690 0.380 1.051