R version 2.8.1 (2008-12-22) 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(8166,2322,2924,5209,5597,5616,5764,5854,6019,6047,6082,6251,6576,6820,7024,7102,7107,7237,7630,7842,8086,8201,8323,9016,9077,9115,9230,9535,9565,9807,9815,9999,10176,10416,10439,10737,10790,11196,11221,11340,11356,11772,11836,11926,12013,12132,12178,12382,12448,12543,12662,12692,12767,13136,13145,13330,13381,13533,14176,14314,14444,15092,15130,15550,15557,15874,15892,16364,16379,16668,16713,16830,17368,17808,17846,18137,18504,18898,18938,19139,19573,19796,19845,21461) > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '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/rcomp/tmp/1b25j1241862032.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/2m64m1241862032.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.952943768 0.901877726 0.858538398 0.820834741 [6] 0.784355574 0.747767720 0.709865394 0.673495306 0.637498964 [11] 0.601449898 0.563950680 0.528407773 0.495861947 0.464177054 [16] 0.431334677 0.398530939 0.364152021 0.332653490 0.301054093 [21] 0.271145726 0.239637217 0.209975083 0.181456930 0.157204570 [26] 0.132324881 0.107178927 0.085633423 0.064846620 0.043915394 [31] 0.023514722 0.002109651 -0.017052435 -0.035907812 -0.054935408 [36] -0.073701363 -0.092324937 -0.110215658 -0.126709790 -0.144172684 [41] -0.161690351 -0.178488874 -0.194544927 -0.211121835 -0.225643916 [46] -0.240740167 -0.255647066 -0.270937640 -0.284064176 > (mypacf <- c(rpacf$acf)) [1] 0.9529437677 -0.0677281985 0.0593874607 0.0309148037 -0.0059459069 [6] -0.0140448869 -0.0303975195 -0.0022865546 -0.0206036718 -0.0212658949 [11] -0.0365227606 -0.0004087333 0.0057136499 -0.0139932016 -0.0287158862 [16] -0.0167927928 -0.0404778536 0.0071237595 -0.0305387768 -0.0017899474 [21] -0.0405694076 -0.0012060575 -0.0147256474 0.0229907904 -0.0279036240 [26] -0.0176866273 0.0212608994 -0.0193622173 -0.0166919757 -0.0120579657 [31] -0.0292233256 0.0028534102 -0.0226382755 -0.0223963352 -0.0134353498 [36] -0.0214700897 -0.0136328067 -0.0110613570 -0.0290475972 -0.0231431731 [41] -0.0133060384 -0.0199804153 -0.0297655084 0.0006967685 -0.0312996726 [46] -0.0189591856 -0.0284187264 -0.0029475729 > 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/3op8y1241862032.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/43sm51241862032.tab") > > system("convert tmp/1b25j1241862032.ps tmp/1b25j1241862032.png") > system("convert tmp/2m64m1241862032.ps tmp/2m64m1241862032.png") > > > proc.time() user system elapsed 0.569 0.334 1.009