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(228,136,174,69,108,149,134,131,180,127,59,59,202,173,296,154,117,86,38,17,52,12,61,65,70,91,111,90,110,100,99,137,139,124,103,75,55,75,65,17,27,17,20,131,26,66,59,35,57,6,24,57,42,55,30,35,22,18,22,82,90,66,64,50,56,99,97,41,59,92,91,47) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '1' > 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: > 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/1so3j1262180923.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/2xjpf1262180923.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.590905120 0.474840157 0.275428726 0.199917066 [6] 0.217922170 0.238187189 0.170437529 0.206583656 0.102141804 [11] 0.080548113 0.057518100 0.201814001 0.130722690 0.215113617 [16] 0.105265667 0.085744573 0.126875784 0.111709839 0.075072863 [21] 0.079112537 0.009307292 0.003090192 0.016678958 -0.042698623 [26] -0.054349569 -0.025135188 -0.060937771 -0.033351687 0.045328750 [31] -0.026626968 0.037167942 -0.048386719 -0.090134263 -0.108183266 [36] -0.146049260 -0.153339947 -0.131300321 -0.135886795 -0.177561184 [41] -0.229377343 -0.213854658 -0.248347501 -0.161450092 -0.213750135 [46] -0.143365452 -0.108468847 -0.141254221 -0.154861143 -0.202358503 [51] -0.169512696 -0.099595792 -0.092619697 -0.103804029 -0.122613689 [56] -0.128316440 -0.118373718 -0.091188920 -0.063634272 -0.055694031 [61] -0.015392556 > (mypacf <- c(rpacf$acf)) [1] 0.5909051199 0.1930935521 -0.1038639161 0.0149032080 0.1557005506 [6] 0.0950948751 -0.0971933220 0.1049506597 -0.0694412648 -0.0326728796 [11] 0.0164113956 0.2744281126 -0.1461611220 0.0770782327 -0.0428851166 [16] -0.0056294727 0.1078783257 -0.0259724155 -0.0706355147 -0.0479560213 [21] 0.0301798941 -0.0588037650 0.0882138305 -0.1673306929 -0.0129321258 [26] 0.0088734429 0.0286662280 -0.0190778869 0.1319198176 -0.1416295802 [31] 0.0325563921 -0.0641774308 -0.0236520650 -0.0656448065 -0.1197310308 [36] 0.0503439102 -0.0737718881 0.0860342255 -0.1638542854 -0.0619632999 [41] -0.0446169679 0.0381755671 -0.0648575930 -0.0327722010 0.0659417158 [46] -0.0003717302 -0.0201947603 -0.0729508393 -0.0574325944 0.0469356757 [51] 0.1063823406 -0.0579497326 0.0089753278 -0.0209176204 -0.0068701788 [56] 0.0724597826 0.0051337810 -0.0169873483 -0.0415151000 0.0519597039 > 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/30vi51262180923.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/4532l1262180923.tab") > > try(system("convert tmp/1so3j1262180923.ps tmp/1so3j1262180923.png",intern=TRUE)) character(0) > try(system("convert tmp/2xjpf1262180923.ps tmp/2xjpf1262180923.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.606 0.307 0.756