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(101.3,91.5,152.6,86.6,86.6,98.5,86.7,89.1,111,92.6,85.1,116.1,98.3,97.7,177.9,94.2,83.8,109.5,102.3,102.5,116.4,85.3,88.2,104.7,99.4,113.8,166.6,89.2,93.2,115,97.2,112.5,121.8,100.2,93.8,113.6,110.7,127.6,185.9,105.9,108,125.2,106.2,123.3,145.2,114.3,108.4,120.9,126.3,141.3,208.2,131.6,119.8,122.5,137.6,141,154.1,127,106.1,129.9) > par5 = '12' > par4 = '0' > par3 = '0' > 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/1vlra1229702478.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/2l5121229702478.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.200386849 0.038384383 0.281081639 0.007142570 [6] 0.132996937 0.517397999 0.079220440 -0.099479879 0.182029256 [11] -0.073912894 0.044502979 0.642196149 0.023375781 -0.081264145 [16] 0.126083958 -0.107330376 -0.010374097 0.273988148 -0.043670423 [21] -0.153522263 0.024843372 -0.173150810 -0.067239764 0.347170150 [26] -0.103472040 -0.136992496 -0.006129766 -0.188700290 -0.105215436 [31] 0.103728851 -0.128230839 -0.196045709 -0.072938790 -0.200822088 [36] -0.123499360 0.169214930 -0.140432749 -0.153983324 -0.050191552 [41] -0.141778566 -0.093532127 0.021863897 -0.130943388 -0.181877330 [46] -0.080702120 -0.140389754 -0.125029264 0.013679111 -0.118497425 [51] -0.113313710 -0.056868735 -0.039711464 -0.034909627 0.005420044 [56] -0.025123030 -0.039799569 0.015260977 -0.005738443 -0.005154780 > (mypacf <- c(rpacf$acf)) [1] 0.2003868488 -0.0018445745 0.2851983953 -0.1183026589 0.1860307111 [6] 0.4321539801 -0.0956580570 -0.1961665037 0.0520857794 -0.1016636140 [11] 0.0529801539 0.5545465935 -0.2466820734 -0.0239896507 -0.1663811341 [16] -0.0675294244 -0.0875482098 -0.2217860920 0.1283508347 0.1332870178 [21] -0.1305228873 0.0704189895 -0.0213957684 -0.0513113532 -0.0737248827 [26] -0.0595010112 0.0111999696 -0.0340159733 -0.0841264336 0.0672327937 [31] -0.0503463121 -0.0827533066 0.0242331029 0.0341593097 -0.0473682069 [36] -0.0190665385 0.0134736818 -0.0214738528 -0.0318677229 0.0727519683 [41] 0.0328649278 -0.1148542341 -0.0657197955 -0.0069950049 -0.0043508764 [46] -0.0505843491 -0.0452317732 -0.1026915230 0.1011317935 0.0001220632 [51] -0.0158450479 0.1229102484 -0.0088697572 0.0276446413 0.0594632145 [56] 0.0113487032 0.0778833137 -0.1142387447 0.0500013423 > 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/3nout1229702478.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/4eics1229702478.tab") > > system("convert tmp/1vlra1229702478.ps tmp/1vlra1229702478.png") > system("convert tmp/2l5121229702478.ps tmp/2l5121229702478.png") > > > proc.time() user system elapsed 0.840 0.435 0.943