R version 2.10.1 (2009-12-14) 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(306,303,344,254,309,310,379,294,356,318,405,545,268,243,273,273,236,222,302,285,309,322,362,471,198,253,173,186,185,105,228,214,189,270,277,378,185,182,258,179,197,168,250,211,260,234,305,347,203,217,227,242,185,175,252,319,202,254,336,431,150,280,187,279,193,227,225,205,259,254,275,394,159,230,188,195,189,220,274) > 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/rcomp/tmp/103ie1275491942.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/203ie1275491942.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.458832539 0.036651300 -0.078185724 0.094710365 [6] 0.083607136 -0.324911373 0.066275194 0.083671533 -0.065470204 [11] 0.023682408 -0.240382753 0.557563117 -0.190129817 -0.048999191 [16] -0.014256373 0.019423174 0.155936905 -0.375393295 0.150557895 [21] -0.008678894 0.048516256 -0.117697532 -0.072711534 0.382090443 [26] -0.145008179 -0.054461807 0.008823707 0.038361353 0.039287593 [31] -0.195809760 0.077720855 -0.025681526 0.075444944 -0.096654274 [36] -0.100546404 0.385583813 -0.229192740 0.096355271 -0.131854554 [41] 0.122663209 0.011238972 -0.185535139 0.080999651 0.016197864 [46] 0.003860785 -0.049089405 -0.068200814 0.276484246 > (mypacf <- c(rpacf$acf)) [1] -0.458832539 -0.220243205 -0.211294713 -0.051897942 0.138775159 [6] -0.279287785 -0.310859686 -0.134795060 -0.228583450 -0.149689446 [11] -0.482909666 0.110022505 0.197571098 0.073889116 0.068577938 [16] -0.045736421 0.085623905 -0.107708346 0.044009889 -0.013067660 [21] 0.114026186 -0.087868180 -0.098855219 0.061382533 -0.048426064 [26] -0.055988184 -0.046757714 0.028549601 -0.209128780 0.014838939 [31] 0.013490261 -0.095097757 -0.006815693 0.016706015 -0.129633539 [36] 0.064243351 -0.059149300 0.074164002 0.023178173 -0.041140444 [41] 0.054047029 -0.012637986 -0.043788192 0.067324720 0.010742556 [46] -0.021941594 0.027042376 -0.045782238 > 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/3plwq1275491942.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/4zdeb1275491942.tab") > > try(system("convert tmp/103ie1275491942.ps tmp/103ie1275491942.png",intern=TRUE)) character(0) > try(system("convert tmp/203ie1275491942.ps tmp/203ie1275491942.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.580 0.380 0.627