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(1384.2,1368.9,-275.1,-408.9,-37.5,171.5,671.8,-18.5,231.6,747.5,1505.7,-83.6,1173.2,1452.1,777,-52.8,861.2,735.2,1073.6,966.9,1189.8,1093.5,1782.7,-70.4,1471.6,1273.8,900.8,-910.2,299.8,460.2,677.2,937.1,1265.4,1275.6,1582.6,-154.2,1667.6,1083.1,891.7,-26.5,423.4,662.8,711.4,993.3,1133.2,343.9,1415.8,-531.8,1193.6,1201.3,805.6,-164.8,327.3,223.7,675.8,949.7,704.4,265.6,1206,-558.2,1066.8,977.8,207.1,-980.7,-586.4,-24.3,-417.5,104.7,749.5,842.3,1176,-730.3,911.6,662.1,539.1,-236,286.9,497.4,912,519.4,260.1,945.2,412.7,-54.2,592.8,179.9,-548.6,-1685.8,-2041,-1048.7,-1708.4,-1550.7,-1650.2,-911.3) > 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/1ompv1229964023.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/2114k1229964023.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.4539329460 0.0488097843 -0.1732877492 0.2703220920 [6] -0.1669428285 0.0370805431 -0.1724297162 0.2457516697 -0.1385047794 [11] 0.0198209535 -0.3721179503 0.7213870662 -0.3556920287 0.0409647805 [16] -0.1610426403 0.2431588311 -0.1453076772 0.0138469744 -0.1166159542 [21] 0.1891972563 -0.0859875519 -0.0232483334 -0.2688206033 0.5826245991 [26] -0.2582952387 0.0559997444 -0.1378238717 0.1711259825 -0.1009176688 [31] 0.0090359871 -0.1007429407 0.1392259197 -0.0482032253 -0.0461983399 [36] -0.1757697789 0.4124051721 -0.1674258419 -0.0019643634 -0.0833884115 [41] 0.1541506878 -0.0908654794 -0.0272591602 -0.0303436832 0.0721132756 [46] 0.0312497215 -0.0918605594 -0.1234866660 0.2971175756 -0.1020395745 [51] -0.0152523964 -0.0585485043 0.1126343890 -0.0406585750 -0.0781137325 [56] 0.0002417149 0.0531337500 0.0286069180 -0.1208534296 -0.0166407038 [61] 0.1769791006 > (mypacf <- c(rpacf$acf)) [1] -0.4539329460 -0.1980557328 -0.3102343058 0.0616649071 -0.0390513561 [6] -0.0491417541 -0.2100998422 0.0106071200 -0.0435281711 -0.0800854574 [11] -0.5298523076 0.4255683505 0.0939918356 -0.0585330663 -0.0267597207 [16] -0.0841252954 -0.0783105119 -0.1340241545 -0.0110973560 -0.0870279064 [21] -0.0577964566 -0.1301313872 -0.0965645989 0.0729103171 0.0709945170 [26] 0.1177503021 0.0859601822 -0.0864136470 -0.0586618215 -0.0091296559 [31] -0.0485158178 -0.0551713503 -0.0353880384 -0.0365097353 0.0455749694 [36] -0.0234536619 0.0576266167 -0.0773679276 -0.0314793742 0.0853011450 [41] -0.0004394729 -0.0855081608 0.0323060831 -0.0351700821 0.0743567243 [46] 0.0508858532 -0.0259020965 -0.0181884220 -0.0738881125 -0.0119357402 [51] -0.0267372169 -0.0311609412 0.0510100731 -0.0296302978 -0.0537308937 [56] 0.0218975854 -0.0558594948 -0.1001182099 0.0721375853 -0.0326453434 > 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/31tr81229964023.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/4b80y1229964023.tab") > > system("convert tmp/1ompv1229964023.ps tmp/1ompv1229964023.png") > system("convert tmp/2114k1229964023.ps tmp/2114k1229964023.png") > > > proc.time() user system elapsed 0.594 0.321 0.710