R version 2.12.0 (2010-10-15) Copyright (C) 2010 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-pc-linux-gnu (32-bit) 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(13.193,15.234,14.718,16.961,13.945,15.876,16.226,18.316,16.748,17.904,17.209,18.950,17.225,18.710,17.236,18.687,17.580,19.568,17.381,19.580,17.260,18.661,15.658,18.674,15.908,17.475,17.725,19.562,16.368,19.555,17.743,19.867,15.703,19.324,18.162,19.074,15.323,19.704,18.375,18.352,13.927,17.795,16.761,18.902,16.239,19.158,18.279,15.698,16.239,18.431,18.414,19.801,14.995,18.706,18.232,19.409,16.263,19.017,20.298,19.891,15.203,17.845,17.502,18.532,15.737,17.770,17.224,17.601,14.940,18.507,17.635,19.392,15.699,17.661,18.243,19.643,15.770,17.344,17.229,17.322,16.152,17.919,16.918,18.114,16.308,17.759,16.021,17.952,15.954,17.762,16.610,17.751,15.458,18.106,15.990,15.349,13.185,15.409,16.007,16.633,14.800,15.974,15.693) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '4' > par4 = '1' > par3 = '0' > 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/rcomp/tmp/1m6pp1293027944.ps",horizontal=F,onefile=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/rcomp/tmp/2m6pp1293027944.ps",horizontal=F,onefile=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.000000000 0.363992182 0.142212550 -0.075008568 -0.322744325 [6] 0.031130523 0.012988996 0.125542450 0.025674316 -0.132777076 [11] -0.035751394 -0.113808280 -0.051266961 0.037530912 -0.044200423 [16] -0.007136832 -0.040149085 0.042241254 0.105137787 0.093642293 [21] 0.122399207 -0.029634521 -0.026515509 -0.065862848 -0.018554051 [26] 0.103172580 -0.001663505 0.043678982 -0.080625666 0.004146675 [31] 0.024186570 -0.059535024 0.047034835 -0.120722680 -0.075880341 [36] -0.005272836 -0.048108541 0.037380803 0.021811331 -0.013041352 [41] 0.041694449 -0.010000471 0.086502404 0.074328985 -0.013172578 [46] 0.051596571 -0.041953233 0.035026635 0.068041806 0.032101515 [51] -0.007330161 -0.127111498 -0.124282054 -0.110955322 0.034579022 [56] 0.111350477 0.073270418 0.020816864 -0.058150067 -0.087366615 [61] -0.057317654 > (mypacf <- c(rpacf$acf)) [1] 0.3639921824 0.0112070688 -0.1501866194 -0.2951465097 0.3275012150 [6] -0.0518371732 0.0479708938 -0.1963964919 0.0305912895 0.0383566138 [11] -0.0365045445 -0.1407504194 0.0925335614 -0.0474510472 -0.0209541976 [16] -0.0565790658 0.1703710278 0.0121818034 0.0465348324 -0.0210023173 [21] -0.0058974901 0.0341594323 -0.0649314184 0.0401854049 0.0777124949 [26] -0.0813078649 0.0033493001 -0.0575938806 0.2354809844 -0.1480164876 [31] -0.0564300658 -0.0014770696 0.0344882027 -0.0941019638 0.0073469527 [36] -0.0348725282 0.0172823567 0.0085138899 -0.0570875372 0.0859659077 [41] 0.0389796691 0.0354773089 -0.0364246838 -0.0171714009 0.0512087148 [46] 0.0053251182 0.0266289474 0.0318225274 0.0004311763 -0.1014770663 [51] -0.0392310476 -0.0066274195 0.0289673273 0.0471647394 0.0166252889 [56] -0.0262195074 0.0016007555 0.0302856205 -0.0881971566 -0.0125441733 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/rcomp/tmp/3iyng1293027944.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/rcomp/tmp/4b74j1293027944.tab") > > try(system("convert tmp/1m6pp1293027944.ps tmp/1m6pp1293027944.png",intern=TRUE)) character(0) > try(system("convert tmp/2m6pp1293027944.ps tmp/2m6pp1293027944.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.710 0.380 1.074