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(58.972,59.249,63.955,53.785,52.760,44.795,37.348,32.370,32.717,40.974,33.591,21.124,58.608,46.865,51.378,46.235,47.206,45.382,41.227,33.795,31.295,42.625,33.625,21.538,56.421,53.152,53.536,52.408,41.454,38.271,35.306,26.414,31.917,38.030,27.534,18.387,50.556,43.901,48.572,43.899,37.532,40.357,35.489,29.027,34.485,42.598,30.306,26.451,47.460,50.104,61.465,53.726,39.477,43.895,31.481,29.896,33.842,39.120,33.702,25.094) > 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/rcomp/tmp/1053q1228415072.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/2o18a1228415072.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.2772610244 -0.1435293929 0.1349554406 -0.0896978855 [6] -0.0366150142 -0.0748840048 -0.1166843206 0.0523794446 0.0912376529 [11] -0.1725437047 -0.2092979325 0.6841920719 -0.1873003271 -0.0801156623 [16] 0.1027803833 -0.1335049148 0.0475174736 -0.0937901298 -0.1365774151 [21] 0.1014734530 0.0319834196 -0.1416883180 -0.0851835257 0.4432714381 [26] -0.1194437672 0.0028422801 0.0093055691 -0.0860950240 0.0808562110 [31] -0.1179699559 -0.0636572348 0.0919251081 0.0083391151 -0.0635880138 [36] -0.0640470931 0.2007940368 -0.0343869874 -0.0063130109 0.0011521246 [41] -0.0639007934 0.0833838002 -0.0936179137 -0.0201059217 0.0196132868 [46] -0.0181141177 -0.0021602924 -0.0297423139 0.0539838677 0.0278828850 [51] -0.0354599000 0.0099731470 -0.0036359697 0.0042707590 0.0041010874 [56] 0.0122482674 0.0081552782 -0.0067185845 -0.0009871345 > (mypacf <- c(rpacf$acf)) [1] -0.277261024 -0.238757213 0.022355908 -0.081642708 -0.065301930 [6] -0.162573036 -0.236368383 -0.135242340 0.006180280 -0.193627752 [11] -0.485186092 0.483557915 0.104440119 0.056860435 -0.071526486 [16] -0.077170228 -0.003057397 -0.048461588 -0.008624327 -0.094421195 [21] -0.138570132 -0.090022199 0.081845215 0.030669949 -0.038835345 [26] 0.018488260 -0.121991212 0.037882925 0.009609626 -0.005472005 [31] 0.053825522 -0.034100786 0.060965599 0.115739210 0.048443246 [36] -0.190394442 -0.069996707 -0.114444233 0.082615038 -0.024299156 [41] -0.037360189 -0.009492094 -0.024544446 -0.022391219 -0.062854617 [46] -0.088479805 -0.056797816 -0.093391949 -0.025851576 -0.074787257 [51] -0.051350351 -0.005655968 -0.095086557 0.002047869 -0.049449016 [56] 0.071917334 -0.020620629 -0.034655594 > 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/3zzg11228415072.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/4i3l61228415072.tab") > > system("convert tmp/1053q1228415072.ps tmp/1053q1228415072.png") > system("convert tmp/2o18a1228415072.ps tmp/2o18a1228415072.png") > > > proc.time() user system elapsed 0.585 0.301 1.171