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(14897,13063,12604,13630,14421,13978,12928,13430,13470,14786,14292,14309,14013,13241,12153,14290,15669,14170,14570,14469,14265,15321,14434,13692,14194,13519,11858,14616,15643,14077,14888,14160,14643,17193,15386,14287,17527,14497,14398,16630,16671,16615,16869,15664,16360,18448,16889,16505,18321,15052,15700,18135,16769,18883,19021,18102,17776,21490,17065,18690,18953,16399,16896,18553,19270,19422,17579,18637,18077,20439,18075,19563,19899,19228,17790,19221,22059,21231,19504,23913,23166,23574,25002,22604,23409) > par5 = '12' > par4 = '1' > par3 = '1' > par2 = '-1.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/1yl3k1228764176.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/2iozn1228764176.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.551752553 -0.001541717 0.331331284 -0.266155280 [6] -0.042135714 0.268777359 -0.308185700 0.027244525 0.296070247 [11] -0.325884858 0.091465300 0.097743665 -0.261770081 0.166458584 [16] 0.022371939 -0.229833900 0.182206560 0.132035498 -0.221369063 [21] 0.147107441 0.078912915 -0.307871073 0.448389454 -0.337749521 [26] 0.022528468 0.225684687 -0.165336108 -0.068357025 0.224897735 [31] -0.237676272 0.014423971 0.164974460 -0.211792743 -0.011376229 [36] 0.216358357 -0.215919959 0.115500338 0.034354653 -0.095070733 [41] 0.051050295 0.078092301 -0.147082785 0.077344120 0.124780786 [46] -0.253161437 0.292018175 -0.167029534 -0.038655811 0.137188510 [51] -0.129927466 -0.037110804 0.110844425 -0.099243841 -0.005005544 [56] 0.126373680 -0.137052821 0.034275464 0.069424444 -0.113273252 [61] 0.056769162 > (mypacf <- c(rpacf$acf)) [1] -0.551752553 -0.439888126 0.155794800 0.109326244 -0.158847212 [6] 0.042593425 -0.102602981 -0.224195011 0.144635370 0.097910949 [11] -0.048322196 -0.180042835 -0.280273702 -0.116543174 -0.005890291 [16] -0.086317622 -0.141348063 0.134441082 0.191918500 0.005426812 [21] 0.071294926 -0.213212059 0.257776177 -0.058570973 -0.036311662 [26] 0.033900542 -0.012536935 -0.132892170 -0.067754518 0.050340452 [31] 0.040599542 -0.157350873 0.050727890 -0.089211606 0.013653702 [36] -0.064532721 0.075228790 0.026694164 0.033367702 -0.072276772 [41] -0.107384356 0.012922961 0.031590759 -0.006908988 -0.059790118 [46] 0.072760817 0.062098192 -0.098916101 -0.002067978 -0.039166271 [51] 0.017681741 -0.097973328 -0.008214905 -0.006732151 -0.019505770 [56] -0.068301289 0.069531249 -0.105975272 0.025118630 -0.104851584 > 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/31qs31228764176.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/4l2qd1228764176.tab") > > system("convert tmp/1yl3k1228764176.ps tmp/1yl3k1228764176.png") > system("convert tmp/2iozn1228764176.ps tmp/2iozn1228764176.png") > > > proc.time() user system elapsed 0.611 0.323 1.405