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(2357402,2199181,2603060,2629720,2638792,2717481,3810804,3871664,2998364,2923432,2712359,2996099,2395029,2483862,3120231,3360606,3177203,3062783,4242509,4026394,3192481,3118695,2782482,3209833,2630190,2592882,3785309,3231539,3421369,3312134,4647303,4289177,3463853,3304422,3006121,3464238,2921118,2624018,3500718,3939351,3467672,3343628,4852445,4597807,3653145,3572079,3334861,3695369,3075704,2852998,3942704,4004560,3822145,3760085,5267816,5271333,4144142,4109749,3896808,4211074,3402318,3279817,4706628,4079499,4344530,4048625,5394915,5611967,4145481,4025610,3552218,3910443) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '1' > 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/1wrve1261007728.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/2gvdl1261007728.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.1484974638 -0.3429510760 -0.0123118575 0.2438000331 [6] 0.1138000441 -0.6843195982 0.0900397464 0.2536977459 -0.0018413709 [11] -0.2851545228 -0.0854072453 0.7373006782 -0.0593524905 -0.3236263369 [16] 0.0147626266 0.1919600021 0.0706057581 -0.5285783949 0.0619917305 [21] 0.2175306355 -0.0302373110 -0.2140521560 -0.0749330591 0.5756151372 [26] -0.0330474003 -0.2455820177 0.0019128871 0.1471325640 0.0661686385 [31] -0.3933460948 0.0195488854 0.1662880824 -0.0125208959 -0.1428484668 [36] -0.0987816840 0.4503045705 -0.0235542253 -0.1662334238 -0.0004577068 [41] 0.0659948310 0.0863702920 -0.2953794986 0.0347852216 0.1070905358 [46] -0.0373275311 -0.0781265970 -0.0320811972 0.2629348032 > (mypacf <- c(rpacf$acf)) [1] -0.148497464 -0.373232917 -0.163559779 0.093762655 0.168072554 [6] -0.632920815 -0.113485792 -0.223623238 -0.152566956 -0.392787249 [11] -0.338417808 0.245721253 0.114304848 0.004716545 0.133380915 [16] -0.073588995 -0.066193914 0.081312160 0.142547151 -0.021617059 [21] 0.019886397 -0.048069947 -0.149155424 -0.035390769 -0.030653219 [26] 0.013544798 -0.062956399 -0.075482187 -0.060487903 0.037976580 [31] -0.037430965 0.010974712 0.027388501 0.074754847 -0.063921985 [36] 0.108125617 -0.093677692 0.048527911 0.003869812 -0.028466894 [41] -0.097791754 0.014465031 -0.009236347 0.061471895 -0.093248225 [46] -0.010161192 0.156889144 -0.089578662 > 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/39rp11261007728.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/4pfuh1261007728.tab") > > try(system("convert tmp/1wrve1261007728.ps tmp/1wrve1261007728.png",intern=TRUE)) character(0) > try(system("convert tmp/2gvdl1261007728.ps tmp/2gvdl1261007728.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.577 0.306 0.790