R version 2.9.0 (2009-04-17) Copyright (C) 2009 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(40801,49081,52431,59650,75428,78705,68870,70641,80074,76464,69976,92917,92559,73981,71107,96942,86270,69610,57768,80077,71454,70382,69881,84530,79322,80181,82137,88439,91575,82909,73282,94089,108112,95653,85273,105093,102275,99308,79687,93263,114918,103374,65124,104045,101183,95492,85035,90692,107486,98179,82551,106804,110898,89950,65184,95357,98280,92146,77874,100039,104777,102341,71316,88838,85457,70784,70522,88629,88452,98886,79601,108135,113835,101617,68698,79182,86003,84165,68550,90385,100368,99081,81288,103491,111695,82504,62237,78249,92341,84412,75102,90461,106451,98379,72615,98367,116949,95832,68060,83923,87653,78054,57566,78784,88916,84662,63442,77773,88102,87972,61790,95276,104418,95420,82141,104064,96287,78426,59111,76837,76615,65860,57703,68656,77955,65856,60947,69885,80550,73694,67538,76326,84727) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '1' > 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: > 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 (par6 == 'White Noise') par6 <- 'white' else par6 <- 'ma' > par7 <- as.numeric(par7) > 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/1yd3p1272908825.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > racf <- acf(x, par1, main='Autocorrelation', xlab='time lag', ylab='ACF', ci.type=par6, ci=par7, sub=paste('(lambda=',par2,', d=',par3,', D=',par4,', CI=', par7, ', CI type=',par6,')',sep='')) > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/2yd3p1272908825.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.00000000 -0.14752908 -0.56052570 -0.06735916 0.71879834 -0.15194663 [7] -0.50955128 -0.13055235 0.71341878 -0.11227962 -0.49559988 -0.05641234 [13] 0.70379908 -0.11568927 -0.49106222 -0.09808227 0.61366506 -0.07595284 [19] -0.44104588 -0.14730172 0.66439113 -0.03393596 -0.45926772 -0.07955385 [25] 0.60982574 -0.06360707 -0.40413021 -0.15703018 0.56515816 -0.01083739 [31] -0.43775422 -0.13272839 0.59792982 -0.04240015 -0.39954702 -0.11431192 [37] 0.54993701 -0.05007514 -0.35924272 -0.15226450 0.53269116 -0.03658266 [43] -0.35858706 -0.11879890 0.50716107 -0.02232156 -0.32097063 -0.09989337 [49] 0.43806360 > (mypacf <- c(rpacf$acf)) [1] -0.1475290762 -0.5952459585 -0.4545266543 0.4470923529 -0.0562714129 [6] -0.1188353666 -0.4292589096 0.1594274969 -0.0446300450 -0.0584708907 [11] -0.0371611591 0.1612680717 0.0679649661 -0.0473734927 -0.1643077623 [16] -0.1573985919 0.0091742271 0.0928619733 -0.1645862814 0.1174005964 [21] 0.0291106051 0.0074536510 0.0789087920 -0.0010841072 0.0509318688 [26] 0.1392309894 -0.0147016755 0.0014609728 0.0041208309 -0.0503986508 [31] 0.0074181184 0.0680432249 -0.0602079706 0.0266948232 0.0006921936 [36] 0.0540743829 -0.0528260759 0.0649690500 0.0079034077 0.0535633912 [41] -0.0584272447 0.0005241332 -0.0022569944 -0.0700081715 0.1065504343 [46] -0.0282994394 0.1485998009 -0.0272784677 > 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/32w1v1272908825.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/4ne0j1272908825.tab") > > try(system("convert tmp/1yd3p1272908825.ps tmp/1yd3p1272908825.png",intern=TRUE)) character(0) > try(system("convert tmp/2yd3p1272908825.ps tmp/2yd3p1272908825.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.561 0.316 0.711