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(96.2,96.8,109.9,88,91.1,106.4,68.6,100.1,108,106,108.6,91.5,99.2,98,96.6,102.8,96.9,110,70.5,101.9,109.6,107.8,113,93.8,108,102.8,116.3,89.2,106.7,112.1,74.2,108.8,111.5,118.8,118.9,97.6,116.4,107.9,121.2,97.9,113.4,117.6,79.6,115.9,115.7,129.1,123.3,96.7,121.2,118.2,102.1,125.4,116.7,121.3,85.3,114.2,124.4,131,118.3,99.6) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '1' > 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/1p4qe1259275630.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/2krrn1259275630.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.696594644 0.207993690 0.049583558 -0.129831091 [6] 0.110874254 -0.042897153 -0.047601362 0.079920913 -0.020552679 [11] -0.035021189 0.097369719 -0.161892797 0.151364562 -0.104906933 [16] 0.071181396 -0.022803180 -0.047804325 0.100111677 -0.103431481 [21] 0.058053589 0.050149497 -0.209156512 0.342026472 -0.340387941 [26] 0.197974927 -0.074520412 0.012272412 0.044138753 -0.071387046 [31] 0.056333972 -0.001883050 -0.045531761 0.033201035 0.033365544 [36] -0.165937834 0.256313991 -0.172311941 0.035377846 0.019982714 [41] -0.041147717 0.061834891 -0.038248070 -0.024941450 0.045045955 [46] -0.013766404 -0.001914396 > (mypacf <- c(rpacf$acf)) [1] -0.6965946443 -0.5386055937 -0.2809911128 -0.2681563845 -0.2082013293 [6] -0.1315217108 -0.2237730279 -0.2590924372 -0.1660160431 -0.1452813886 [11] 0.0780422272 0.0008585206 0.0273382274 -0.0634113947 0.0113024498 [16] 0.0922859079 0.0123246242 0.0581941377 -0.0282285557 -0.0884110196 [21] 0.1431774400 -0.1505108659 0.1868117307 0.0530467639 0.0618318467 [26] -0.1416549156 -0.1434956708 -0.0615537389 -0.1436931794 -0.0867507038 [31] -0.0501057060 -0.0982395522 -0.0405195044 0.0514893508 -0.1070726258 [36] -0.1262794149 0.0770030932 0.0590960133 -0.0133328025 -0.0307199470 [41] -0.0633864126 0.0600673139 0.0483742131 -0.0240015091 0.0474974594 [46] -0.0732212751 > 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/3y6zn1259275630.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/4yyfe1259275630.tab") > > system("convert tmp/1p4qe1259275630.ps tmp/1p4qe1259275630.png") > system("convert tmp/2krrn1259275630.ps tmp/2krrn1259275630.png") > > > proc.time() user system elapsed 0.598 0.314 0.696