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(100.00,100.00,93.55,88.17,89.25,91.40,92.47,91.40,88.17,87.10,84.95,92.47,93.55,93.55,91.40,90.32,91.40,93.55,93.55,92.47,91.40,89.25,86.02,88.17,87.10,87.10,86.02,84.95,84.95,86.02,86.02,84.95,86.02,82.80,77.42,80.65,78.49,75.27,75.27,75.27,77.42,78.49,76.34,73.12,68.82,65.59,69.89,82.80,84.95,80.65,74.19,70.97,74.19,82.80,86.02,86.02,82.80,78.49,79.57,87.10,89.25) > 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/1yfsu1261136397.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/22api1261136397.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.3380871034 -0.2955852363 -0.5251786402 -0.3520564588 [6] 0.1445973692 0.5345504145 0.3527402234 -0.0573277384 -0.3377620812 [11] -0.3198121236 -0.0140817964 0.3634238150 0.0828464269 -0.0656797084 [16] -0.0787227775 -0.0887355396 -0.0042842956 0.0932992095 0.0250634203 [21] -0.0531737192 -0.0611407851 -0.0572988919 0.0436716694 0.1628747014 [26] -0.1074724107 -0.1427760297 -0.0723775020 -0.0146523205 0.0829186438 [31] 0.1292915211 0.0390048201 -0.1199735706 -0.1684250934 0.0051633368 [36] 0.1706874773 0.2341474770 -0.0231588159 -0.1772442751 -0.1920091723 [41] -0.0367991719 0.1627494213 0.2668091717 0.0722792820 -0.1902313028 [46] -0.2604467273 -0.0629721802 0.1343850902 0.2074728518 0.0483929380 [51] -0.1040828739 -0.1474562774 -0.0618492602 0.0273685764 0.0838003346 [56] 0.0451235851 -0.0608838742 -0.0800720087 -0.0175809991 0.0005547778 > (mypacf <- c(rpacf$acf)) [1] 3.380871e-01 -4.627859e-01 -3.197316e-01 -2.432498e-01 9.008761e-02 [6] 2.596316e-01 4.387000e-02 7.511267e-02 3.909803e-02 1.688890e-03 [11] 6.270825e-03 1.527254e-01 -4.630199e-01 1.199284e-01 7.641821e-02 [16] 9.036512e-03 -5.498621e-02 -8.135661e-03 9.556371e-02 -1.988196e-02 [21] -4.250006e-02 -1.497778e-01 6.807094e-02 4.929962e-02 -1.622995e-01 [26] -8.031130e-02 -9.427839e-02 6.477792e-02 -1.138773e-02 -2.616606e-02 [31] 6.338165e-02 -3.139560e-02 3.019855e-05 2.434490e-01 -1.029887e-03 [36] 2.782088e-02 3.865662e-02 -1.006840e-01 -8.302714e-02 -2.018548e-02 [41] -4.432896e-02 1.014965e-01 -9.319861e-02 4.829711e-02 6.670716e-02 [46] -1.759774e-02 -2.861752e-02 -1.075845e-01 5.242484e-03 -7.228402e-02 [51] 3.575130e-02 -9.674464e-02 -3.324659e-02 -5.931292e-02 4.445608e-02 [56] 4.568568e-03 -5.750623e-02 -8.470300e-02 6.926557e-02 > 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/3xhzi1261136397.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/4uokv1261136397.tab") > > try(system("convert tmp/1yfsu1261136397.ps tmp/1yfsu1261136397.png",intern=TRUE)) character(0) > try(system("convert tmp/22api1261136397.ps tmp/22api1261136397.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.605 0.313 0.777