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(10.9,10,9.2,9.2,9.5,9.6,9.5,9.1,8.9,9,10.1,10.3,10.2,9.6,9.2,9.3,9.4,9.4,9.2,9,9,9,9.8,10,9.8,9.3,9,9,9.1,9.1,9.1,9.2,8.8,8.3,8.4,8.1,7.7,7.9,7.9,8,7.9,7.6,7.1,6.8,6.5,6.9,8.2,8.7,8.3,7.9,7.5,7.8,8.3,8.4,8.2,7.7,7.2,7.3,8.1,8.5) > par7 = '' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > 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: Write here your technical program description (don't use hard returns!) > 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 (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/11ocf1260612183.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > racf <- acf(x,par1,main='Autocorrelation',xlab='lags',ylab='ACF') > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/22d5z1260612183.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.00000000 0.41437735 -0.24901640 -0.51034538 -0.34439192 0.09296819 [7] 0.38822882 0.24658363 -0.12575639 -0.33613303 -0.24955180 0.05810084 [13] 0.37679455 0.10445787 -0.10988822 -0.10221223 -0.06024556 0.05690707 [19] 0.09300296 0.01119965 -0.14207035 -0.19183457 -0.08892524 0.10808329 [25] 0.23430893 0.01299130 -0.15955887 -0.10064701 -0.03663157 0.09761635 [31] 0.15747888 0.08705020 -0.15594928 -0.24267270 -0.06687902 0.16838962 [37] 0.29264723 0.11867940 -0.13167522 -0.16274302 -0.04343888 0.16799641 [43] 0.24246916 0.07720744 -0.22621767 -0.32284803 -0.11701666 0.11348198 [49] 0.20978668 0.08742165 -0.08971506 -0.11607956 -0.03576939 0.05973475 [55] 0.10800583 0.04646671 -0.07294626 -0.10401405 -0.03726337 > (mypacf <- c(rpacf$acf)) [1] 0.4143773523 -0.5079432032 -0.2347355966 -0.1361075041 0.1082824623 [6] 0.0960964404 -0.0769202467 -0.1144860186 -0.0584256819 -0.0576419959 [11] 0.0280242857 0.1823021414 -0.3970193642 0.2699185417 0.1020167458 [16] -0.0756896166 0.0194353201 -0.0981002942 0.0668187921 -0.1452256572 [21] -0.1450122364 -0.0346751535 0.0881877527 -0.0694100944 -0.0248558949 [26] -0.1108702003 0.0721618673 -0.0178868599 -0.0459446607 0.0325506460 [31] -0.0155473525 -0.1757625882 0.0408030154 0.0695206231 -0.0128470412 [36] 0.1322290015 0.0068500951 0.0008943926 0.0605023246 0.1406543788 [41] 0.0991277890 0.0171084296 -0.1217816644 0.0699465325 -0.0527349213 [46] -0.1230361595 -0.0370337250 -0.0925904652 0.0529737643 0.0215681901 [51] -0.0654024736 0.0278496199 -0.0611697719 -0.0324295923 0.0867658717 [56] -0.0307565580 0.0027386961 -0.0234393878 > 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/3raer1260612183.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/45avb1260612183.tab") > > system("convert tmp/11ocf1260612183.ps tmp/11ocf1260612183.png") > system("convert tmp/22d5z1260612183.ps tmp/22d5z1260612183.png") > > > proc.time() user system elapsed 0.585 0.303 0.709