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(8.6,8.5,8.3,7.8,7.8,8,8.6,8.9,8.9,8.6,8.3,8.3,8.3,8.4,8.5,8.4,8.6,8.5,8.5,8.5,8.5,8.5,8.5,8.5,8.5,8.5,8.5,8.5,8.6,8.4,8.1,8,8,8,8,7.9,7.8,7.8,7.9,8.1,8,7.6,7.3,7,6.8,7,7.1,7.2,7.1,6.9,6.7,6.7,6.6,6.9,7.3,7.5,7.3,7.1,6.9,7.1) > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '0' > par3 = '2' > 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/1wn2u1259863308.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/2vugx1259863308.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.0212792620 -0.0901042761 -0.4254067629 -0.3108891190 [6] -0.0081327261 0.2213544502 0.1236262971 0.1525408282 -0.0429040857 [11] -0.0550291259 -0.1617140369 0.1063165649 -0.1875058543 0.1567306061 [16] 0.0986471194 -0.0167743013 0.0047252088 -0.1142935984 -0.0638681650 [21] 0.0930105390 0.0847031333 0.0508469427 -0.0341068178 -0.1831527889 [26] -0.1067380743 0.1657709065 0.1446891083 -0.0260880132 -0.0599442038 [31] -0.1959955343 0.0718148194 0.1060887220 0.1358842457 0.0206830730 [36] -0.0644909356 -0.2346073127 -0.0598150928 0.0340726414 0.1270793830 [41] 0.0795678073 0.1436486257 -0.1329210221 -0.0056289857 -0.1701657431 [46] -0.0643846090 -0.0005240387 0.1695695541 0.1310147364 0.1146315654 [51] -0.1617178343 -0.1583520882 -0.1155619239 0.1266996448 0.0504823941 [56] 0.0840955523 -0.0510747856 -0.0176818756 > (mypacf <- c(rpacf$acf)) [1] 0.0212792620 -0.0905981066 -0.4250676977 -0.3885976114 -0.2066514480 [6] -0.1067971109 -0.2776965083 -0.1113816476 -0.0736337700 -0.0385539946 [11] -0.1619650268 0.1727438411 -0.2270069832 0.0282838159 0.1844758373 [16] -0.0621955773 0.0136563902 0.0085997959 0.0385716817 0.0128305208 [21] 0.1448328165 0.0841905296 0.0883918310 -0.1481011929 -0.0003306271 [26] 0.1113351344 0.0240464527 -0.1536840853 -0.1551917553 -0.1844093228 [31] -0.0933086634 -0.1098323285 0.0044384737 0.0395610978 0.0345686074 [36] -0.0434221304 -0.0504373586 -0.0207195683 0.0177737511 -0.0856924530 [41] 0.0428720521 -0.0715403453 0.0041494464 0.0148939798 -0.0569404082 [46] -0.1425802361 0.0125963490 0.0248498426 -0.0336844714 -0.0298191569 [51] 0.0649140294 0.0101979902 0.0116722457 0.0100048748 -0.0812083647 [56] -0.0053676849 0.0465601063 > 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/3d1nx1259863308.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/4mcso1259863308.tab") > > system("convert tmp/1wn2u1259863308.ps tmp/1wn2u1259863308.png") > system("convert tmp/2vugx1259863308.ps tmp/2vugx1259863308.png") > > > proc.time() user system elapsed 0.608 0.303 0.687