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(154,96,73,49,36,59,95,169,210,278,298,245,200,118,90,79,78,91,167,169,289,347,375,203,223,104,107,85,75,99,135,211,335,460,488,326,346,261,224,141,148,145,223,272,445,560,612,467,518,404,300,210,196,186,247,343,464,680,711,610,613,392,273,322,189,257,324,404,677,858,895,664,628,308,324,248,272) > 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/freestat/rcomp/tmp/17dtt1272528737.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/freestat/rcomp/tmp/2i5sw1272528737.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.30510224 0.30399021 -0.10085593 -0.29838988 -0.48702105 [7] -0.38623132 -0.42897293 -0.21915919 0.01950807 0.17703930 0.37685965 [13] 0.62529087 0.25465826 0.18611948 -0.04314395 -0.24742216 -0.33086931 [19] -0.33256281 -0.31654249 -0.12901693 -0.04848451 0.16369442 0.21596201 [25] 0.48179402 0.18250327 0.21991598 -0.03017602 -0.13130400 -0.27273598 [31] -0.22200376 -0.25085983 -0.12606086 -0.08306774 0.09022918 0.13658718 [37] 0.35085069 0.17231465 0.16747330 0.02278889 -0.12491013 -0.15770497 [43] -0.16751914 -0.16913063 -0.13657599 -0.05937495 0.04262086 0.08233060 [49] 0.26263270 > (mypacf <- c(rpacf$acf)) [1] 0.305102245 0.232550334 -0.283245573 -0.345439846 -0.325441741 [6] -0.097518539 -0.271761866 -0.295808269 -0.097947485 -0.121304757 [11] -0.039995282 0.386041663 -0.154920655 -0.229334989 0.129375850 [16] 0.124465440 0.010553353 -0.100070266 0.031641639 0.130731928 [21] -0.213954487 0.033100419 -0.136631313 0.107413231 0.058359114 [26] -0.051490368 -0.052800865 0.003088048 0.043119762 0.133509391 [31] -0.072301933 -0.061370554 -0.024634676 0.102055023 -0.023737569 [36] -0.084878426 0.006161442 -0.019786306 -0.026362859 -0.093466110 [41] 0.016288871 0.039241182 -0.010465106 -0.093513425 0.005369888 [46] 0.042773304 -0.031957814 -0.024434087 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/html/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/3ln9k1272528737.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/freestat/rcomp/tmp/4ee851272528737.tab") > > try(system("convert tmp/17dtt1272528737.ps tmp/17dtt1272528737.png",intern=TRUE)) character(0) > try(system("convert tmp/2i5sw1272528737.ps tmp/2i5sw1272528737.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.807 0.416 0.932