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(105.2,91.5,75.3,60.5,80.4,84.5,93.9,78,92.3,90,72.1,76.9,76,88.7,55.4,46.6,90.9,84.9,89,90.2,72.3,83,71.6,75.4,85.1,81.2,68.7,68.4,93.7,96.6,101.8,93.6,88.9,114.1,82.3,96.4,104,88.2,85.2,87.1,85.5,89.1,105.2,82.9,86.8,112,97.4,88.9,109.4,87.8,90.5,79.3,114.9,118.8,125,96.1,116.7,119.5,104.1,121,127.3,117.7,108,89.4,137.4,142,137.3,122.8,126.1,147.6,115.7,139.2,151.2,123.8,109,112.1,136.4,135.5,138.7,137.5,141.5,143.6,146.5,200.7,196.2) > par5 = '12' > par4 = '1' > par3 = '0' > par2 = '0.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/freestat/rcomp/tmp/19xrt1228994427.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/20axf1228994427.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.344141131 0.277083112 0.365694700 0.119428966 [6] 0.085624931 0.177584368 0.052507032 0.168231717 -0.022010333 [11] -0.041174022 -0.012310632 -0.233362461 -0.130290713 -0.156896817 [16] -0.185458384 -0.099967831 -0.056700109 -0.183201610 -0.014982629 [21] -0.011049890 -0.101273083 0.009200791 0.118169930 -0.071170520 [26] 0.041680727 0.188796746 0.168634038 0.173250501 0.258192399 [31] 0.204228322 0.120542890 0.048791280 0.078450029 0.043536772 [36] 0.018119890 0.017245418 0.061021745 -0.122995633 -0.169151321 [41] -0.148914778 -0.241048238 -0.173344053 -0.097958498 -0.164719914 [46] -0.047669254 -0.084655159 -0.174087896 -0.022017210 > (mypacf <- c(rpacf$acf)) [1] 0.344141131 0.179963650 0.264434386 -0.109104913 -0.040030945 [6] 0.093744047 -0.015277455 0.156005093 -0.222023159 -0.036709347 [11] -0.050741424 -0.200919702 0.049550316 -0.151698243 0.076424068 [16] -0.037319021 0.104917097 -0.123120246 0.091498085 0.134931210 [21] -0.144642155 0.129893327 0.056274503 -0.150488639 0.036921053 [26] 0.154786541 0.155785041 -0.043087998 0.188206113 -0.095340527 [31] -0.051387732 -0.030056404 -0.082871439 0.009073785 0.007271393 [36] -0.092464012 0.068964473 -0.169840274 -0.097511272 -0.026001641 [41] 0.067836944 -0.006685022 0.026256770 0.080696465 -0.028868350 [46] -0.053881906 0.050247507 -0.003426119 > 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/3rl1q1228994427.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/4digy1228994427.tab") > > system("convert tmp/19xrt1228994427.ps tmp/19xrt1228994427.png") > system("convert tmp/20axf1228994427.ps tmp/20axf1228994427.png") > > > proc.time() user system elapsed 0.865 0.466 1.709