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(155,154,153,151,171,170,155,145,146,146,147,149,146,155,149,140,155,152,137,127,134,125,132,141,133,143,141,132,144,140,130,122,124,119,128,131,121,123,116,109,116,109,103,98,95,83,92,94,76,75,77,68,80,66,69,67,68,64,72,70,55,55,54,55,67,54,57,53,49,47,64,58,38,41,38,41,60,49,53,55,56,52,68,68,41,46,41,47,62,48,53,61,59,46,69,69,42,42,42,50,64,47,51,66,64,49,71,68,39,30,22,33,46,24,27,45,38,18,36,31) > 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/17fem1281095172.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/27fem1281095172.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.951771490 0.917464691 0.899863079 0.874458051 [6] 0.848288169 0.822370558 0.789839379 0.771838700 0.754574726 [11] 0.718106605 0.702928581 0.700355155 0.659105960 0.627400836 [16] 0.606217153 0.583398978 0.562065205 0.539315699 0.508481706 [21] 0.492140106 0.475672544 0.445220039 0.427545700 0.415328972 [26] 0.376595051 0.346421166 0.318998052 0.292155078 0.269373938 [31] 0.244916715 0.209342857 0.186321702 0.166008576 0.134180055 [36] 0.112130526 0.093407811 0.059583301 0.036380191 0.015170083 [41] -0.006707219 -0.023757336 -0.041650895 -0.071321541 -0.089491920 [46] -0.106133203 -0.128992012 -0.144935540 -0.158705529 -0.180871485 [51] -0.188853502 -0.201141196 -0.213132041 -0.221129454 -0.227976005 [56] -0.247534502 -0.255834969 -0.263972936 -0.278615282 -0.286963583 [61] -0.294521945 > (mypacf <- c(rpacf$acf)) [1] 0.9517714898 0.1231870262 0.1830522459 -0.0368231869 -0.0042507134 [6] -0.0319079978 -0.0888232184 0.1187116703 0.0193370922 -0.1616265840 [11] 0.1642606305 0.1330480016 -0.3454376627 0.0116863272 0.0419023049 [16] 0.0221823184 -0.0362016966 0.0291693496 -0.0123692507 -0.0240246356 [21] -0.0159775313 0.0265983569 -0.0160941407 -0.0389626688 -0.1494583179 [26] 0.0103401205 -0.0542641616 0.0032824430 0.0047699292 0.0175319180 [31] -0.0834051516 -0.0331939311 0.0238885442 -0.0290124916 -0.0323460204 [36] 0.0005295039 -0.0378214961 0.0129404313 0.0049377661 0.0129397741 [41] -0.0173783419 -0.0195652644 -0.0537697878 -0.0122482777 -0.0180789076 [46] 0.0106969775 -0.0123292503 0.0181387486 0.0052862826 0.0738940400 [51] -0.0516036998 0.0246473289 -0.0273303864 0.0146883931 -0.0752068704 [56] 0.0264621704 -0.0000305232 -0.0482354537 -0.0158805298 0.0469701229 > 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/3l7td1281095172.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/47qsj1281095172.tab") > > try(system("convert tmp/17fem1281095172.ps tmp/17fem1281095172.png",intern=TRUE)) character(0) > try(system("convert tmp/27fem1281095172.ps tmp/27fem1281095172.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.618 0.327 0.770