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(153.3 + ,154.5 + ,155.2 + ,156.9 + ,157 + ,157.4 + ,157.2 + ,157.5 + ,158 + ,158.5 + ,159 + ,159.3 + ,160 + ,160.8 + ,161.9 + ,162.5 + ,162.7 + ,162.8 + ,162.9 + ,163 + ,164 + ,164.7 + ,164.8 + ,164.9 + ,165 + ,165.8 + ,166.1 + ,167.2 + ,167.7 + ,168.3 + ,168.6 + ,168.9 + ,169.1 + ,169.5 + ,169.6 + ,169.7 + ,169.8 + ,170.4 + ,170.9 + ,171.9 + ,171.9 + ,172 + ,172 + ,172.4 + ,173 + ,173.7 + ,173.8 + ,173.8 + ,173.9 + ,174.6 + ,175 + ,175.9 + ,176 + ,175.1 + ,175.6 + ,175.9 + ,176.7 + ,176.1 + ,176.1 + ,176.2 + ,176.3 + ,177.8 + ,178.5 + ,179.4 + ,179.5 + ,179.6 + ,179.7 + ,179.7 + ,179.8 + ,179.9 + ,180.2 + ,180.4 + ,180.4 + ,181.3 + ,181.9 + ,182.5 + ,182.7 + ,183.1 + ,183.6 + ,183.7 + ,183.8 + ,183.9 + ,184.1 + ,184.4 + ,184.5 + ,185.9 + ,186.6 + ,187.6 + ,187.8 + ,187.9 + ,188 + ,188.3 + ,188.4 + ,188.5 + ,188.5 + ,188.6 + ,188.6 + ,189.4 + ,190 + ,191.9 + ,192.5 + ,193 + ,193.5 + ,193.9 + ,194.2 + ,194.9 + ,194.9 + ,194.9 + ,194.9 + ,195.5 + ,196 + ,196.2 + ,196.2 + ,196.2 + ,196.2 + ,197 + ,197.7 + ,198 + ,198.2 + ,198.5 + ,198.6 + ,199.5 + ,200 + ,201.3 + ,202.2 + ,202.9 + ,203.5 + ,203.5 + ,204 + ,204.1 + ,204.3 + ,204.5 + ,204.8 + ,205.1 + ,205.7 + ,206.5 + ,206.9 + ,207.1 + ,207.8 + ,208 + ,208.5 + ,208.6 + ,209 + ,209.1 + ,209.7 + ,209.8 + ,209.9 + ,210 + ,210.8 + ,211.4 + ,211.7 + ,212 + ,212.2 + ,212.4 + ,212.9 + ,213.4 + ,213.7 + ,214 + ,214.3 + ,214.8 + ,215 + ,215.9 + ,216.4 + ,216.9 + ,217.2 + ,217.5 + ,217.9 + ,218.1 + ,218.6 + ,218.9 + ,219.3 + ,220.4 + ,220.9 + ,221 + ,221.8 + ,222 + ,222.2 + ,222.5 + ,222.9 + ,223.1 + ,223.4 + ,224 + ,225.1 + ,225.5 + ,225.9 + ,226.3 + ,226.5 + ,227 + ,227.3 + ,227.8 + ,228.1 + ,228.4 + ,228.5 + ,228.8 + ,229 + ,229.1 + ,229.3 + ,229.6 + ,229.9 + ,230 + ,230.2 + ,230.8 + ,231 + ,231.7 + ,231.9 + ,233 + ,235.1 + ,236 + ,236.9 + ,237.1 + ,237.5 + ,238.2 + ,238.9 + ,239.1 + ,240 + ,240.2 + ,240.5 + ,240.7 + ,241.1 + ,241.4 + ,242.2 + ,242.9 + ,243.2 + ,243.9) > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '0' > par3 = '1' > par2 = '1' > par1 = '36' > #'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/12cdm1259094133.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/24ja01259094133.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.2179736275 0.1542695844 -0.1830820376 -0.1238954823 [6] -0.0209465403 0.0073685786 -0.0253834046 -0.1659479428 -0.1806798610 [11] 0.0008666441 0.0694509573 0.2333453334 0.0814832567 0.0169011514 [16] -0.0919549328 -0.0503794618 0.0797630233 0.0015951406 0.0029835066 [21] -0.1407678551 -0.1733351374 0.0272722076 0.1014547171 0.3272326906 [26] 0.1170608324 0.0660234599 -0.0816095525 -0.1597583788 -0.0241203089 [31] -0.0653714653 -0.0477616693 -0.1465867355 -0.1538001543 0.0415974526 [36] 0.0634568352 0.2794485927 > (mypacf <- c(rpacf$acf)) [1] 0.217973627 0.112082397 -0.252381983 -0.060294537 0.097907971 [6] -0.022871802 -0.092274768 -0.159591456 -0.100792360 0.119292594 [11] 0.032475326 0.113727190 -0.010187547 -0.027148662 -0.032104894 [16] -0.008863406 0.086925735 -0.063494855 -0.017824105 -0.049429334 [21] -0.094800974 0.116425857 0.070449934 0.197605273 0.009184261 [26] 0.006180537 -0.010570433 -0.152926516 -0.016251728 -0.032919709 [31] -0.035838694 -0.030614882 -0.039198670 0.100985267 -0.001946867 [36] 0.102317470 > 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/3vewv1259094133.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/48hsd1259094133.tab") > > system("convert tmp/12cdm1259094133.ps tmp/12cdm1259094133.png") > system("convert tmp/24ja01259094133.ps tmp/24ja01259094133.png") > > > proc.time() user system elapsed 0.565 0.349 0.709