R version 2.11.1 (2010-05-31) Copyright (C) 2010 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(568,567,566,564,584,583,568,558,559,559,560,562,563,552,552,555,575,567,548,541,544,546,551,550,546,532,523,528,555,543,525,517,519,521,520,516,509,494,484,482,508,500,480,467,471,482,481,477,471,455,441,434,459,448,432,414,415,423,425,427,415,399,386,377,397,379,361,350,348,363,367,365,354,327,312,307,335,317,298,286,288,303,310,301,293,264,255,251,279,253,233,226,232,245,250,242,230,196,188,181,212,186,166,155,157,173,182,182,168,131,114,106,134,103,83,74,83,96,95,100) > par7 = '0.95' > par6 = 'White Noise' > 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: > 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/rcomp/tmp/1br6l1279625630.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/rcomp/tmp/2br6l1279625630.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.975951587 0.949742954 0.925221554 0.902842176 [6] 0.878190435 0.851975500 0.825936420 0.801399730 0.774307545 [11] 0.751103521 0.730899804 0.712537584 0.688400969 0.663625295 [16] 0.639318547 0.616060504 0.591164974 0.565615843 0.540763286 [21] 0.516970525 0.490177309 0.466649587 0.444853530 0.424872951 [26] 0.400329342 0.376406581 0.353913361 0.332175365 0.307975391 [31] 0.283178103 0.259317908 0.236855359 0.211812237 0.189427329 [36] 0.168970414 0.150081577 0.127435691 0.105913888 0.085688924 [41] 0.065969602 0.044196735 0.022274982 0.001744728 -0.017518631 [46] -0.039575220 -0.059829647 -0.077761724 -0.094147209 > (mypacf <- c(rpacf$acf)) [1] 0.9759515875 -0.0576311739 0.0241789081 0.0292107889 -0.0625381225 [6] -0.0387634017 -0.0090689775 0.0110879893 -0.0705707701 0.0777965951 [11] 0.0420882437 0.0194309443 -0.1238721266 -0.0135179187 -0.0183686526 [16] -0.0125792082 -0.0354372123 -0.0226601091 0.0024981575 -0.0005408453 [21] -0.0599027002 0.0500061233 0.0007064109 0.0065496700 -0.0916668088 [26] 0.0088259615 -0.0022783137 -0.0209161690 -0.0459410781 -0.0271211761 [31] 0.0009422449 -0.0022603106 -0.0414430101 0.0284928927 0.0054122326 [36] -0.0031512828 -0.0693748541 0.0110564277 -0.0155395485 -0.0286988884 [41] -0.0323962725 -0.0206607214 0.0065074019 -0.0079539754 -0.0410452868 [46] 0.0040337306 0.0123808974 -0.0081779051 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/rcomp/tmp/370lu1279625630.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/rcomp/tmp/4s1k01279625630.tab") > > try(system("convert tmp/1br6l1279625630.ps tmp/1br6l1279625630.png",intern=TRUE)) character(0) > try(system("convert tmp/2br6l1279625630.ps tmp/2br6l1279625630.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.570 0.060 0.636