R version 2.7.0 (2008-04-22) 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(1961782,1787447,1953757,1828167,2078223,1777226,1538059,1678452,2262924,1616451,1829222,1763216,2138777,1565784,1781485,1962103,1775358,1837255,1917824,1878651,2124030,1948811,1947985,1719466,2139078,2086587,2020001,2405555,2152069,2791310,2397287,1885473,1978324,2165120,2052877,1726766,2267082,2501737,1916630,2177682,1859283,1718749,1819181,1463556,1979279,1723911,1528538,1635412,2255789,1698773,1635959,2054968,1794346,1938855,2112672,1446965,1610773,1576815,1509935,1769046) > par5 = '12' > par4 = '0' > par3 = '2' > par2 = '1' > par1 = '48' > #'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/1lcp91229339101.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/2twg41229339101.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.6041161964 -0.0005803411 0.1629324038 -0.0177314745 [6] -0.0545854613 0.0009380115 0.0043877433 0.0179257907 -0.0200523626 [11] 0.1048506113 -0.2716476923 0.3665766171 -0.2471234932 -0.0357588067 [16] 0.2558583883 -0.2928345336 0.2039726776 -0.0986055332 0.0840570449 [21] -0.1176690461 0.0510278291 0.1200071099 -0.2289347570 0.1229034039 [26] 0.0762620893 -0.1428034181 0.1240936653 -0.1280572759 0.1038769693 [31] -0.0017538642 -0.1101420184 0.1016817968 -0.0499932043 0.0957965266 [36] -0.1752069941 0.1520151736 -0.0246170515 -0.0469152912 -0.0311799049 [41] 0.1135198849 -0.0851064660 0.0252432091 -0.0209428626 0.0536348779 [46] -0.0898595462 0.1145510480 -0.0765233369 -0.0157733419 > (mypacf <- c(rpacf$acf)) [1] -0.604116196 -0.575608836 -0.436500862 -0.250135762 -0.085406633 [6] -0.029254027 -0.106130145 -0.172866049 -0.219467237 0.128853671 [11] -0.168651960 0.149177142 0.074478385 -0.160894458 0.108764367 [16] -0.168578972 0.071816484 -0.037509496 0.200974940 0.026339992 [21] -0.083675832 0.059478674 -0.032301787 -0.106682675 -0.067427994 [26] 0.098969013 0.029206676 0.119171077 -0.092914687 0.061130596 [31] -0.123927597 -0.095444202 -0.033505892 -0.082516522 -0.024442367 [36] -0.069339557 -0.072197373 0.063607221 -0.160655273 -0.042277827 [41] -0.006104365 -0.052066070 0.077843620 -0.084097098 -0.128702217 [46] -0.024646254 0.030240059 0.094339530 > 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/3d5l31229339101.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/46p361229339101.tab") > > system("convert tmp/1lcp91229339101.ps tmp/1lcp91229339101.png") > system("convert tmp/2twg41229339101.ps tmp/2twg41229339101.png") > > > proc.time() user system elapsed 2.014 0.963 2.144