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(94.20,95.20,95.00,94.00,92.20,91.00,91.20,103.40,105.00,104.60,103.80,101.80,102.40,103.80,103.40,102.00,101.80,100.20,101.40,113.80,116.00,115.60,113.00,109.40,111.00,112.40,112.20,111.00,108.80,107.40,108.60,118.80,122.20,122.60,122.20,118.80,119.00,118.20,117.80,116.80,114.60,113.40,113.80,124.20,125.80,125.60,122.40,119.00,119.40,118.60,118.00,116.00,114.80,114.60,114.60,124.00,125.20,124.00,117.60,113.20,111.40,112.20,109.80,106.40,105.20,102.20,99.80,111.00,113.00,108.40,105.40,102.00,102.80) > 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/freestat/rcomp/tmp/1jxzs1228330897.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/2yz9n1228330897.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.246135883 -0.153887299 -0.298945758 -0.282305379 [6] 0.048955940 0.172324871 0.058390451 -0.229040785 -0.246305970 [11] -0.106221196 0.222015542 0.752937583 0.210252958 -0.125319618 [16] -0.291496193 -0.263285318 0.030349501 0.111214115 0.049249872 [21] -0.181910698 -0.189004214 -0.071192770 0.157874087 0.573872619 [26] 0.157315468 -0.136906337 -0.252138356 -0.215997828 0.013475050 [31] 0.068669659 0.028155024 -0.149079793 -0.130687961 -0.055142783 [36] 0.104051693 0.438389319 0.098513472 -0.131338375 -0.235599475 [41] -0.165788653 0.005656543 0.081475369 0.034632918 -0.113847800 [46] -0.099532311 -0.054940977 0.044048319 0.309753875 0.065995519 [51] -0.117050409 -0.155978780 -0.117459969 -0.010272379 0.068805185 [56] 0.008067349 -0.053905793 -0.039350584 -0.040057328 0.004285943 [61] 0.161724515 > (mypacf <- c(rpacf$acf)) [1] 0.2461358834 -0.2283013222 -0.2203686727 -0.2096349210 0.0918695169 [6] 0.0098919875 -0.0868743400 -0.2813245013 -0.1128939769 -0.1039111561 [11] 0.1275190069 0.6614239333 -0.0575138431 0.1208731345 0.0217572914 [16] 0.0782525863 -0.0269982448 -0.1029330176 -0.0168628769 -0.0353517637 [21] -0.0005874433 -0.0453239390 -0.0978820616 0.0313626830 -0.0813321447 [26] -0.0894914539 0.0131971930 0.0156624329 -0.0251000054 -0.0287424660 [31] -0.0219615614 -0.0002789060 0.0064603548 -0.0605962105 -0.0349330527 [36] 0.0088882508 -0.0562650498 -0.0273938018 -0.0936724526 0.0388598878 [41] -0.0710258680 0.0885385342 -0.0080480715 0.0415938770 -0.0076834080 [46] -0.0106372888 -0.0707607696 -0.0619975265 -0.0313710666 -0.0518299773 [51] 0.0968668014 -0.0442220976 -0.0265631154 -0.0304829607 -0.0807359250 [56] 0.0699588141 -0.0074024763 0.0356388788 0.0008246199 -0.1063369953 > 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/3t4b91228330897.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/4vdt41228330897.tab") > > system("convert tmp/1jxzs1228330897.ps tmp/1jxzs1228330897.png") > system("convert tmp/2yz9n1228330897.ps tmp/2yz9n1228330897.png") > > > proc.time() user system elapsed 0.912 0.464 10.718