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(12.1,12,11.8,12.7,12.3,11.9,12,12.3,12.8,12.4,12.3,12.7,12.7,12.9,13,12.2,12.3,12.8,12.8,12.8,12.2,12.6,12.8,12.5,12.4,12.3,11.9,11.7,12,12.1,11.7,11.8,11.8,11.8,11.3,11.3,11.3,11.2,11.4,12.2,12.9,13.1,13.5,13.6,14.4,14.1,15.1,15.8,15.9,15.4,15.5,14.8,13.2,12.7,12.1,11.9,10.6,10.7,9.8,9,8.3,9.3,9,9.1,10) > par7 = '0.95' > par6 = 'MA' > 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/1hid81261333237.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/2e1911261333237.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.9280837004 0.8229356623 0.6983352116 0.5531298023 [6] 0.3622451593 0.1856264727 0.0220955845 -0.1393094970 -0.2935816002 [11] -0.4063364409 -0.4975386743 -0.5806730868 -0.6003534474 -0.5655568077 [16] -0.5091947546 -0.4526021924 -0.3667093535 -0.2760526585 -0.2012242598 [21] -0.1366407130 -0.0587260527 0.0075094765 0.0560470239 0.1008580064 [26] 0.1456177646 0.1628572892 0.1582496670 0.1577784039 0.1533628727 [31] 0.1395733019 0.1228767544 0.1217139637 0.1124193218 0.0902545846 [36] 0.0686277021 0.0608569819 0.0363999590 0.0068589284 -0.0140764266 [41] -0.0309010347 -0.0495312980 -0.0608108800 -0.0589514394 -0.0661586928 [46] -0.0799994878 -0.0803426903 -0.0689683434 -0.0669936482 -0.0681820510 [51] -0.0595482020 -0.0431410716 -0.0282578629 -0.0144503637 -0.0007068948 [56] 0.0002305092 0.0049713144 0.0155772974 0.0214834546 0.0138664071 [61] 0.0091051122 > (mypacf <- c(rpacf$acf)) [1] 0.9280837004 -0.2769617342 -0.1554759298 -0.1907650317 -0.4175857126 [6] 0.0911085049 -0.0537646385 -0.1595206694 -0.0530640263 0.0163655859 [11] -0.1332466503 -0.1676413458 0.3583709167 0.0595248872 -0.0518594108 [16] -0.1193985548 -0.1470068059 -0.1346961969 -0.0851225032 0.0166150016 [21] 0.0253256702 0.0364694472 -0.0296529463 -0.1000392070 0.0723176812 [26] -0.0073489115 -0.0168553712 0.0381871207 -0.0571917908 0.0008276537 [31] -0.0888642809 0.0298904789 -0.0240970005 -0.0485957630 0.0241593806 [36] 0.0466926036 -0.0628395474 -0.0595076358 -0.0266877366 -0.0871317351 [41] 0.1136027195 0.1105552010 -0.0029175131 -0.0873203307 -0.0997635578 [46] -0.0283384310 -0.0142545933 0.1018471797 -0.0507507307 -0.0734036735 [51] 0.0161910060 0.0108289506 -0.0106261530 0.0182068659 -0.0435191194 [56] 0.0545547913 -0.0220021758 -0.1029359716 -0.0595221876 -0.0010882993 > 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/3erv41261333237.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/4bew41261333237.tab") > > try(system("convert tmp/1hid81261333237.ps tmp/1hid81261333237.png",intern=TRUE)) character(0) > try(system("convert tmp/2e1911261333237.ps tmp/2e1911261333237.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.592 0.320 0.700