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' > 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/1zi031261302364.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/2r8dx1261302364.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.2883300859 0.0752992912 0.2186304794 0.2321837662 [6] 0.2559739461 -0.0272583962 -0.0459588021 0.1433231507 0.0275865009 [11] -0.1605204788 0.1234611773 -0.0119320700 -0.0418275539 0.0532364333 [16] -0.0578684645 0.0413102922 -0.1263011713 -0.1745612293 0.0175708536 [21] -0.0960991192 -0.1729274464 -0.1807536271 -0.1628562286 -0.1190378188 [26] -0.0700538758 -0.1223598445 -0.0293444165 0.0522106282 -0.0370297482 [31] -0.0404843830 -0.0810335799 -0.0204162795 -0.0410445324 -0.0898929497 [36] -0.1140289682 -0.0440527063 -0.0069356805 -0.0319911323 -0.0532689467 [41] -0.0466880680 0.0114516703 0.0146459156 0.0234066942 -0.0068250211 [46] 0.0038887512 0.0123142776 0.0017078829 0.0073349750 0.0142674602 [51] 0.0230423080 0.0165460305 0.0056059593 0.0049479178 0.0189552926 [56] 0.0177091668 0.0091575502 0.0006119586 -0.0013578769 > (mypacf <- c(rpacf$acf)) [1] 0.288330086 -0.008545359 0.217275352 0.127021345 0.183771189 [6] -0.201928781 -0.054692933 0.072195591 -0.062618674 -0.172828566 [11] 0.303652581 -0.175789828 0.014487153 0.109795492 -0.055905418 [16] -0.088074925 -0.098264269 -0.061399157 -0.007781940 -0.087372578 [21] 0.056538855 -0.204512607 -0.003873065 -0.044681969 0.050161036 [26] 0.011482472 0.054820700 0.108124938 -0.020347972 -0.161084437 [31] 0.009655707 -0.082673124 -0.085754336 0.007426195 -0.039183625 [36] 0.027113773 0.037237069 0.070511606 -0.137082997 -0.066836352 [41] 0.012080025 -0.048671873 0.018543037 0.016206041 -0.021750754 [46] -0.008599175 -0.048053529 0.011634709 0.020766028 0.041887838 [51] 0.016277569 -0.034768443 -0.049123743 -0.038855000 -0.038756419 [56] -0.054490769 -0.089944359 0.062850256 > 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/3yqd91261302364.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/4j0e41261302364.tab") > > try(system("convert tmp/1zi031261302364.ps tmp/1zi031261302364.png",intern=TRUE)) character(0) > try(system("convert tmp/2r8dx1261302364.ps tmp/2r8dx1261302364.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.571 0.345 0.757