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(485,464,460,467,460,448,443,436,431,484,510,513,503,471,471,476,475,470,461,455,456,517,525,523,519,509,512,519,517,510,509,501,507,569,580,578,565,547,555,562,561,555,544,537,543,594,611,613,611,594,595,591,589,584,573,567,569,621,629,628,612,595,597,593,590,580,574,573,573,620,626,620,588,566,557,561,549,532,526,511,499,555,565,542,527,510,514,517,508,493,490,469,478,528) > 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: 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/freestat/rcomp/tmp/1oozb1229889354.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/freestat/rcomp/tmp/2jjpu1229889354.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.0028716233 0.0006085898 -0.0447236798 0.0815587059 [6] 0.0268137511 0.0618690356 -0.0042678000 0.1051223828 0.0861640431 [11] -0.0825917743 0.0329661338 -0.3015127804 -0.0565937382 0.1548170651 [16] 0.0088680230 -0.0641959966 -0.0628100484 0.0414250207 0.0427419272 [21] -0.0351319975 -0.0015956304 0.0617667516 0.1726758518 -0.0798505631 [26] -0.1177723567 -0.1952320313 0.0504004419 -0.0197408123 0.1134227296 [31] -0.0962287889 -0.0657532705 0.0129823969 -0.0842001902 -0.0765084333 [36] -0.0800014320 0.0071112952 0.0805537656 0.1455501345 -0.1174476050 [41] -0.0341321714 -0.0143351028 -0.0436957256 0.0443835855 -0.0861461434 [46] -0.0537144435 0.0315341577 -0.0997550298 -0.0721792629 -0.0651779230 [51] 0.0129363691 -0.0098192642 -0.0017822987 -0.1275251363 0.0392847280 [56] -0.0988856158 0.0015751736 0.0607950535 -0.0237529023 0.0283326685 [61] 0.0604191598 > (mypacf <- c(rpacf$acf)) [1] -0.0028716233 0.0006003485 -0.0447205941 0.0814664733 0.0272642405 [6] 0.0603770018 0.0032570257 0.1023246352 0.0898373259 -0.0934954109 [11] 0.0404419549 -0.3271501801 -0.0934650077 0.1669813414 -0.0360943883 [16] -0.0113530596 -0.0499095678 0.0829488479 0.0682925038 -0.0013632396 [21] 0.1112280775 -0.0326228051 0.1919584701 -0.1729175539 -0.2298104359 [26] -0.1346061154 -0.0328074560 -0.0546526195 0.0753801146 -0.0139771470 [31] -0.0135117264 0.0699966992 0.0068826940 -0.0157419414 0.0598582020 [36] -0.0501940760 -0.0903163109 0.0618982072 -0.0591268083 -0.0677345433 [41] 0.0036105348 -0.1127613023 -0.0081250867 -0.0463479313 -0.0789695031 [46] -0.0312638447 -0.0633651441 0.0319109290 -0.0502402486 0.0902433112 [51] -0.0289222894 -0.1323669040 0.0203110690 0.0118014949 -0.1141873936 [56] -0.0416280564 0.0010834007 -0.0809523794 -0.0397255058 0.0572354350 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/html/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/3qiyu1229889354.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/freestat/rcomp/tmp/4ssrv1229889354.tab") > > system("convert tmp/1oozb1229889354.ps tmp/1oozb1229889354.png") > system("convert tmp/2jjpu1229889354.ps tmp/2jjpu1229889354.png") > > > proc.time() user system elapsed 0.819 0.427 0.963