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(2921.44,2981.85,3080.58,3106.22,3119.31,3061.26,3097.31,3161.69,3257.16,3277.01,3295.32,3363.99,3494.17,3667.03,3813.06,3917.96,3895.51,3801.06,3570.12,3701.61,3862.27,3970.1,4138.52,4199.75,4290.89,4443.91,4502.64,4356.98,4591.27,4696.96,4621.4,4562.84,4202.52,4296.49,4435.23,4105.18,4116.68,3844.49,3720.98,3674.4,3857.62,3801.06,3504.37,3032.6,3047.03,2962.34,2197.82,2014.45,1862.83,1905.41,1810.99,1670.07,1864.44,2052.02,2029.6,2070.83,2293.41,2443.27,2513.17,2466.92) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '1' > par2 = '1.4' > 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/1kkpx1261923053.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/20qsu1261923053.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.0000000000 0.2663680298 0.0641658577 0.2035173405 0.1967806685 [6] 0.2683083262 0.0200520739 -0.0265610288 0.1458372388 0.0355022517 [11] -0.1273791461 0.1535969758 -0.0100105119 -0.0517739472 0.0693179674 [16] -0.0543722625 0.0332856709 -0.1333377334 -0.1866541320 0.0152641014 [21] -0.0962816071 -0.1766252611 -0.1904312769 -0.1743133311 -0.1273378743 [26] -0.0647697394 -0.1140129158 -0.0262535282 0.0448116843 -0.0454024737 [31] -0.0507956372 -0.0848946211 -0.0207888776 -0.0448522256 -0.0854922898 [36] -0.1069058508 -0.0409743230 -0.0050457394 -0.0264321719 -0.0493287010 [41] -0.0458807280 0.0067150540 0.0125542523 0.0219979169 -0.0057279334 [46] 0.0033285060 0.0107011371 0.0021421345 0.0067776862 0.0128902267 [51] 0.0192737336 0.0129786035 0.0042536867 0.0040261986 0.0159452555 [56] 0.0149844472 0.0079041459 0.0005249018 -0.0011702046 > (mypacf <- c(rpacf$acf)) [1] 0.2663680298 -0.0073043256 0.2026336981 0.1031091777 0.2177316715 [6] -0.1447073677 -0.0430689823 0.0698089501 -0.0645498448 -0.1694031604 [11] 0.2820754049 -0.1572167080 -0.0097890579 0.1086963931 -0.0508617541 [16] -0.0762726920 -0.1198230796 -0.0641252139 -0.0158258155 -0.0826011322 [21] 0.0297844608 -0.1946169566 -0.0167657221 -0.0399679814 0.0388216645 [26] 0.0329475183 0.0681625211 0.1124728586 -0.0007225947 -0.1489449751 [31] -0.0137822697 -0.0540879231 -0.0905879015 -0.0032401845 -0.0516623327 [36] 0.0349069765 0.0286161879 0.0595112855 -0.1230349725 -0.0732120483 [41] 0.0050998689 -0.0381477868 -0.0015710870 0.0198294955 -0.0074684691 [46] -0.0045565651 -0.0325731594 -0.0056852426 0.0341739591 0.0458605451 [51] 0.0171796481 -0.0394021272 -0.0542074388 -0.0361698009 -0.0516540426 [56] -0.0553051817 -0.0814801450 0.0431700182 > 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/3yrqd1261923053.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/49hy11261923053.tab") > > try(system("convert tmp/1kkpx1261923053.ps tmp/1kkpx1261923053.png",intern=TRUE)) character(0) > try(system("convert tmp/20qsu1261923053.ps tmp/20qsu1261923053.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.595 0.306 0.764