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(1515,1510,1225,1577,1417,1224,1693,1633,1639,1914,1586,1552,2081,1500,1437,1470,1849,1387,1592,1589,1798,1935,1887,2027,2080,1556,1682,1785,1869,1781,2082,2570,1862,1936,1504,1765,1607,1577,1493,1615,1700,1335,1523,1623,1540,1637,1524,1419,1821,1593,1357,1263,1750,1405,1393,1639,1679,1551,1744,1429,1784) > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '-2.0' > 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/1gxq61228483798.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/2bxys1228483798.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.266810648 0.228134700 0.365617748 0.191441117 [6] 0.023952934 0.055729577 -0.043014834 0.111094417 0.168154379 [11] 0.032610613 -0.049772310 0.197105026 0.063669707 -0.128502440 [16] 0.016357660 -0.123789756 -0.106853966 -0.232334554 -0.230984810 [21] -0.214612806 -0.134273116 -0.207358340 -0.160589909 -0.073114481 [26] -0.120481529 -0.249513856 -0.170743489 -0.191060304 -0.214518828 [31] -0.173391891 -0.162867735 -0.015139169 -0.004662768 0.025589259 [36] -0.102156586 0.200379432 0.091148693 -0.064826958 0.064042169 [41] 0.092275441 -0.045293759 0.023802373 -0.047613383 -0.001629870 [46] 0.063811216 0.111096257 -0.017762413 0.110472056 0.189668211 [51] 0.001606465 0.055222955 0.064386195 -0.016384216 0.029527341 [56] -0.009444508 -0.036218321 0.037277108 -0.028217420 0.001336025 [61] -0.005191399 > (mypacf <- c(rpacf$acf)) [1] 0.2668106484 0.1689758155 0.2991823300 0.0311823422 -0.1446798021 [6] -0.0771315695 -0.1152156197 0.2136493564 0.2357223102 0.0051455452 [11] -0.2651973384 0.0395783984 0.0516064306 -0.0711306971 0.0448368225 [16] -0.2232549958 -0.0566331327 -0.2644946951 0.0108726920 -0.0005421694 [21] 0.0247678456 -0.0670055553 -0.0615849352 0.0171521622 -0.1356097616 [26] -0.1102155359 -0.0991765493 0.0332089465 -0.0237296127 0.0202826328 [31] -0.0049759231 0.0613556266 0.0379996468 0.0644260764 -0.1810660652 [36] 0.1849837530 0.0377361996 -0.0779521791 -0.0122677735 -0.0950534166 [41] -0.0580562340 -0.0700583208 0.0096244454 -0.1001077873 -0.1184081397 [46] 0.0220523706 -0.0539475406 -0.0083830226 -0.0661751510 0.0551646486 [51] -0.0375442496 0.0185957648 -0.0831948113 0.0193969378 -0.0304533990 [56] 0.0047262757 0.0326081287 -0.1102484953 0.0562976704 -0.0399908713 > 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/34fve1228483798.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/4qb151228483798.tab") > > system("convert tmp/1gxq61228483798.ps tmp/1gxq61228483798.png") > system("convert tmp/2bxys1228483798.ps tmp/2bxys1228483798.png") > > > proc.time() user system elapsed 0.591 0.340 0.724