R version 2.8.0 (2008-10-20) Copyright (C) 2008 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(528,478,469,490,493,508,517,514,510,527,542,565,555,499,511,526,532,549,561,557,566,588,620,626,620,573,573,574,580,590,593,597,595,612,628,629,621,569,567,573,584,589,591,595,594,611,613,611,594,543,537,544,555,561,562,555,547,565,578,580) > 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/1ti1h1230119876.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/2yy781230119876.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.244589752 -0.174355692 -0.265864641 -0.254450169 [6] 0.031603187 0.165196628 0.049556943 -0.278316534 -0.284683049 [11] -0.168593269 0.250217180 0.716561965 0.125431803 -0.137283616 [16] -0.250550811 -0.199686730 0.031266704 0.117246332 0.025812633 [21] -0.265821620 -0.231306239 -0.088802012 0.161005356 0.491885738 [26] 0.101071964 -0.129280029 -0.212832769 -0.121007314 0.024484931 [31] 0.079583305 0.014262207 -0.211928207 -0.145976075 -0.079563142 [36] 0.113076197 0.355261330 0.071849621 -0.101566857 -0.110351519 [41] -0.038724352 0.022090487 0.062874448 0.023551808 -0.129962309 [46] -0.088736149 -0.032737311 0.093476556 0.173163930 0.030121402 [51] -0.029882310 -0.030861263 -0.005150979 0.005467872 0.043631610 [56] 0.026385126 -0.048301640 -0.031311057 -0.002839352 > (mypacf <- c(rpacf$acf)) [1] 0.2445897517 -0.2490808899 -0.1719962014 -0.2066159734 0.0687971380 [6] 0.0205458512 -0.0736055190 -0.3334595212 -0.1560694192 -0.2233232909 [11] 0.1795005103 0.5640262651 -0.2204563018 0.0817614343 -0.0754930067 [16] 0.0381597194 -0.0821433205 -0.1268487653 -0.0314669365 -0.0265179025 [21] 0.0317836947 0.0395574488 -0.2641767478 0.0494854468 0.0104117674 [26] -0.1137291038 -0.0182740173 -0.0632629139 -0.0223484321 -0.0202290927 [31] -0.0865646920 0.0121595197 -0.0488054013 -0.1177054335 0.0382441139 [36] -0.1388198464 0.0029614619 -0.0558822730 0.0413036064 0.0138761140 [41] -0.0574725858 -0.0094745246 0.0147172099 -0.0159988151 0.0246344706 [46] 0.0093951731 -0.0236861638 -0.1411213332 0.0174390230 0.0532266337 [51] -0.0317450649 -0.0384978247 -0.0374509387 0.0458251608 0.0204902968 [56] 0.0525520211 -0.0449214096 0.0008393585 > 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/32rh61230119876.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/4hm6q1230119876.tab") > > system("convert tmp/1ti1h1230119876.ps tmp/1ti1h1230119876.png") > system("convert tmp/2yy781230119876.ps tmp/2yy781230119876.png") > > > proc.time() user system elapsed 0.592 0.310 0.723