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(2.14,2.45,2.52,2.3,2.25,2.06,1.99,2.25,2.26,2.36,2.3,2.19,2.31,2.21,2.21,2.26,2.18,2.21,2.33,2.12,2.08,1.97,2.09,2.11,2.24,2.45,2.68,2.73,2.76,2.83,3.16,3.22,3.22,3.34,3.35,3.42,3.58,3.71,3.68,3.83,3.94,3.88,4.03,4.15,4.32,4.4,4.37,4.14,4.11,4.16,3.98,4.13,3.76,3.66,3.85,4.03,4.31,4.58,4.46,4.41,3.84,2.84,2.66,2.17,1.43,1.47,1.29,1.23,1.09,0.94,0.76,0.67) > 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/1e41c1262771792.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/2amdo1262771792.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.940627800 0.866462210 0.783385325 0.685739780 [6] 0.592309391 0.496746447 0.401726646 0.310073482 0.234723211 [11] 0.170782869 0.111048432 0.072413637 0.048797183 0.023877136 [16] -0.003273842 -0.037999799 -0.082260010 -0.131535938 -0.184997290 [21] -0.234870563 -0.270949439 -0.308872132 -0.335181109 -0.361063324 [26] -0.380325360 -0.386200554 -0.386212398 -0.383684666 -0.382019249 [31] -0.383132006 -0.381500033 -0.372663796 -0.364961066 -0.356900716 [36] -0.340277790 -0.320201874 -0.297460009 -0.270049633 -0.236523828 [41] -0.201371805 -0.161556054 -0.124062093 -0.097309376 -0.070012298 [46] -0.043009699 -0.016693145 0.007080195 0.018961220 0.024885562 [51] 0.030559984 0.027515338 0.032102476 0.037739428 0.048957567 [56] 0.061309584 0.071737874 0.084580144 0.098408977 0.106645081 [61] 0.118491720 > (mypacf <- c(rpacf$acf)) [1] 0.940627800 -0.158987610 -0.103847423 -0.162106841 0.008568936 [6] -0.076379051 -0.047591897 -0.050269642 0.082823977 0.008453965 [11] -0.052484284 0.095797567 0.055529934 -0.092260531 -0.109872481 [16] -0.112149767 -0.099246599 -0.079804104 -0.082223764 0.021345749 [21] 0.116683786 -0.090353384 0.040774514 -0.077220011 -0.006896516 [26] -0.019587907 -0.052756636 -0.090820613 -0.062186418 -0.091170606 [31] 0.007456241 0.094865158 -0.027045304 -0.011244703 0.050815945 [36] -0.027197781 -0.031874373 -0.032073543 0.007204829 -0.013170285 [41] -0.002548618 -0.072471487 -0.031990244 0.018695321 0.034675575 [46] 0.044575951 -0.005380877 -0.125488430 -0.073062270 -0.018768070 [51] -0.093870129 0.080963727 -0.022103434 0.056559657 -0.023963210 [56] -0.022845852 0.036985601 0.044242352 -0.111333886 0.005499722 > 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/3nl651262771792.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/46fm51262771792.tab") > > try(system("convert tmp/1e41c1262771792.ps tmp/1e41c1262771792.png",intern=TRUE)) character(0) > try(system("convert tmp/2amdo1262771792.ps tmp/2amdo1262771792.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.607 0.314 1.321