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(23100 + ,22650 + ,22440 + ,22910 + ,22980 + ,22535 + ,22300 + ,22780 + ,22780 + ,23300 + ,23800 + ,24510 + ,24660 + ,24730 + ,25070 + ,24690 + ,24880 + ,23920 + ,23880 + ,23990 + ,24590 + ,23610 + ,23580 + ,23360 + ,23910 + ,23940 + ,23060 + ,22800 + ,23020 + ,22890 + ,22780 + ,22530 + ,22290 + ,22820 + ,22480 + ,22110 + ,22000 + ,22230 + ,22260 + ,22590 + ,22820 + ,22420 + ,22230 + ,21600 + ,21000 + ,21360 + ,21640 + ,21450 + ,21710 + ,21620 + ,21800 + ,21490 + ,21670 + ,22130 + ,22050 + ,22050 + ,22140 + ,22390 + ,22220 + ,21790 + ,21510 + ,21670 + ,21745 + ,21850 + ,22105 + ,22050 + ,21670 + ,21680 + ,21800 + ,21920 + ,21980 + ,22270 + ,21740 + ,21950 + ,22010 + ,21890 + ,21920 + ,22110 + ,22340 + ,22210 + ,22240 + ,21960 + ,22220 + ,22060 + ,22090 + ,21960 + ,21940 + ,21790 + ,21710 + ,21690 + ,21710 + ,21670 + ,21640 + ,21500 + ,21290 + ,21250 + ,21580 + ,21670 + ,21620 + ,21510 + ,21360 + ,21420 + ,21470 + ,21370 + ,21370 + ,21340 + ,21130 + ,21130 + ,20990 + ,21240 + ,21320 + ,21430 + ,21390 + ,21530 + ,21510 + ,21630 + ,21560 + ,21610 + ,21560 + ,21310 + ,21340 + ,21410 + ,21550 + ,21380 + ,21600 + ,21530 + ,21560 + ,21670 + ,21540 + ,21540 + ,21550 + ,21590 + ,21420 + ,21420 + ,21370 + ,21380 + ,21210 + ,21505 + ,21365 + ,21385 + ,21350 + ,21360 + ,21530 + ,21380 + ,21630 + ,22145 + ,22315 + ,22340 + ,22440 + ,22135 + ,21955 + ,22060 + ,22050 + ,22035 + ,22280 + ,22315 + ,22205 + ,21970 + ,22075 + ,22115 + ,22105 + ,21885 + ,21805 + ,21910 + ,21995 + ,22245 + ,22100 + ,22130 + ,22300 + ,22915 + ,23040 + ,22880 + ,23000 + ,23160 + ,23020 + ,22770 + ,22660 + ,22740 + ,22905 + ,22720 + ,22705 + ,22735 + ,22600 + ,22510 + ,22560 + ,22575 + ,22685 + ,22980 + ,23275 + ,23845 + ,23640 + ,23640 + ,23835 + ,23625 + ,24055 + ,24005 + ,24325 + ,24445 + ,24670 + ,24615 + ,24700 + ,25065 + ,25185 + ,25220 + ,25235 + ,24975 + ,25055 + ,25520 + ,25880 + ,25960 + ,25740 + ,24965 + ,25235 + ,24895 + ,24635 + ,24835 + ,24635 + ,24695 + ,25090 + ,25220 + ,24740 + ,25005 + ,24650 + ,24460 + ,24680 + ,24840 + ,24630 + ,24490 + ,24695) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '0' > 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/html/rcomp/tmp/12qcy1273095623.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/22qcy1273095623.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.00000000 0.97182305 0.94491781 0.92031175 0.89719542 0.87190835 [7] 0.84902535 0.82516671 0.80224979 0.78108076 0.74940119 0.72312132 [13] 0.69817203 0.67643084 0.65124662 0.62965837 0.60548252 0.57940186 [19] 0.55273483 0.52240626 0.49507049 0.46619194 0.43774526 0.41482623 [25] 0.39402970 0.37110310 0.34541001 0.32026806 0.29899578 0.27826349 [31] 0.25570481 0.23147208 0.21160402 0.19371057 0.17872457 0.16291441 [37] 0.15338865 0.14341109 0.13405288 0.12328104 0.11066601 0.10134179 [43] 0.09409573 0.08817680 0.07953891 0.07090036 0.06107082 0.05091725 [49] 0.04165924 > (mypacf <- c(rpacf$acf)) [1] 0.971823046 0.008599240 0.028053403 0.015842582 -0.048412571 [6] 0.030464014 -0.030445512 0.004699723 0.021867205 -0.203699631 [11] 0.083851374 -0.005831092 0.041739745 -0.051908955 0.030279458 [16] -0.046460547 -0.061369775 -0.028233459 -0.061447883 0.011207561 [21] -0.052292713 -0.030933485 0.124296281 -0.020607739 -0.010461929 [26] -0.068725415 -0.013697448 0.069913992 -0.040748622 -0.020924171 [31] -0.058202765 0.031545794 0.026061144 0.067222347 0.011683262 [36] 0.086633365 -0.027173924 0.001488856 -0.020886534 -0.047658100 [41] 0.016422506 0.037327612 -0.002861185 -0.025789545 -0.047973254 [46] 0.006950127 -0.031184844 0.014577489 > 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/35ra41273095623.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/4999s1273095623.tab") > > try(system("convert tmp/12qcy1273095623.ps tmp/12qcy1273095623.png",intern=TRUE)) character(0) > try(system("convert tmp/22qcy1273095623.ps tmp/22qcy1273095623.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.560 0.303 0.785