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 = '1' > 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/1fzor1261141158.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/2w2ok1261141158.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.0000000000 -0.4958083183 -0.1225833271 0.2464997683 -0.0781058070 [6] -0.0455086212 -0.0061237859 0.0599459240 -0.0258378755 0.0039874973 [11] 0.1741730709 -0.3653911674 0.2781898566 -0.0390093439 -0.0403873721 [16] -0.0042171532 -0.0269460692 0.0792892961 -0.0162388634 -0.0487078313 [21] -0.0260280769 0.0494989608 0.0692932581 -0.1768798309 0.0947274337 [26] 0.0128465028 -0.0072932138 0.0257908175 -0.1014263843 0.0706073506 [31] 0.0840801394 -0.1448883784 0.0078247596 0.0896544517 -0.0273548584 [36] -0.0784144403 0.1021824123 0.0017866422 -0.1336713380 0.1083358666 [41] 0.0112522663 -0.1420104891 0.1592105681 -0.0191545647 -0.0694369608 [46] 0.0466862325 -0.0323417382 -0.0277331111 0.0287650859 -0.0097105597 [51] 0.0318556480 -0.0117140135 -0.0227769271 -0.0013121784 0.0206475012 [56] -0.0186152139 0.0093351836 0.0044297277 -0.0043443427 -0.0009240656 > (mypacf <- c(rpacf$acf)) [1] -0.495808318 -0.488493585 -0.150061901 -0.046280901 -0.001454565 [6] -0.093605153 -0.035521379 -0.012190030 0.048370614 0.343278234 [11] -0.138148568 0.031963610 -0.076603930 0.158983533 0.043094751 [16] -0.079140273 -0.098403831 0.029183520 0.070141729 -0.110980265 [21] -0.039226576 -0.077873443 -0.021113738 -0.066655040 -0.030078715 [26] -0.018958281 0.071317409 -0.031294874 -0.007018479 0.147914681 [31] -0.027128075 -0.038215325 0.008420174 0.020331529 -0.078734578 [36] 0.011829499 0.101992195 -0.068546987 -0.151522603 -0.071634084 [41] -0.035624038 0.034726633 -0.021493339 -0.005035220 0.060789704 [46] -0.057509499 -0.115471377 -0.036022400 -0.056341185 0.055173305 [51] 0.038460059 -0.060141576 -0.002851185 -0.039928760 0.019570225 [56] 0.094273980 0.010778918 -0.073880058 -0.014542955 > 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/3tbdy1261141158.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/4otym1261141158.tab") > > try(system("convert tmp/1fzor1261141158.ps tmp/1fzor1261141158.png",intern=TRUE)) character(0) > try(system("convert tmp/2w2ok1261141158.ps tmp/2w2ok1261141158.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.589 0.319 0.968