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(104.1,90.2,99.2,116.5,98.4,90.6,130.5,107.4,106,196.5,107.8,90.5,123.8,114.7,115.3,197,88.4,93.8,111.3,105.9,123.6,171,97,99.2,126.6,103.4,121.3,129.6,110.8,98.9,122.8,120.9,133.1,203.1,110.2,119.5,135.1,113.9,137.4,157.1,126.4,112.2,128.8,136.8,156.5,215.2,146.7,130.8,133.1,153.4,159.9,174.6,145,112.9,137.8,150.6,162.1,226.4,112.3,126.3) > 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/1wvjv1260194379.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/24uki1260194379.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.596893628 0.159390868 -0.034826755 -0.135009918 [6] 0.231684373 -0.064595733 -0.097029088 0.035978393 0.042765380 [11] -0.095233328 0.326994216 -0.488376856 0.303579709 -0.125449060 [16] 0.016189772 0.093520768 -0.145905334 0.173351181 -0.154805939 [21] 0.047543242 0.088408704 -0.108518943 -0.001571150 0.098646204 [26] -0.159650653 0.144201757 -0.022586971 -0.115063710 0.144281535 [31] -0.203521114 0.217802456 -0.048423737 -0.103243577 0.090458502 [36] -0.026618495 -0.023097537 0.101565497 -0.096497655 -0.005716245 [41] 0.063709679 -0.059349043 0.126437584 -0.146645640 0.060221486 [46] -0.012222004 0.004120809 > (mypacf <- c(rpacf$acf)) [1] -0.596893628 -0.305865511 -0.159652697 -0.335134346 -0.074735015 [6] 0.131725606 -0.045627592 -0.148529388 0.040649855 -0.120322835 [11] 0.320665191 -0.121673438 -0.080486528 -0.108429688 -0.106996080 [16] -0.170569959 -0.096811680 0.214301992 -0.010324459 -0.176526355 [21] 0.173161896 -0.029687144 -0.019561180 0.022179443 -0.033960783 [26] -0.137912284 -0.026566611 -0.144328794 -0.176122162 -0.142848913 [31] -0.013091873 -0.059817543 0.070235361 -0.021102844 0.014074493 [36] -0.034190682 0.050200462 -0.017336199 -0.023878890 -0.057428590 [41] -0.072092398 -0.089792240 0.013912879 0.001744901 -0.028912844 [46] 0.038931263 > 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/3hh0f1260194379.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/48y8a1260194379.tab") > > system("convert tmp/1wvjv1260194379.ps tmp/1wvjv1260194379.png") > system("convert tmp/24uki1260194379.ps tmp/24uki1260194379.png") > > > proc.time() user system elapsed 0.575 0.310 0.723