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(4940,3924,3927,4535,3446,3016,4934,2743,3242,6662,3262,3381,7144,3803,3684,6759,3386,3066,5538,2940,3215,7023,3443,3712,7475,4137,3491,7019,3908,3402,5604,3222,3636,7123,4368,4092,8377,4595,4188,6988,4218,3655,6211,3622,3841,8510,4627,4582,8967,4928,4809,7917,4790,4065,7290,4670,3561,5149,6880,6981,8454,4960,4670,7638,4560,3980,6825,3939,4079,8117,5121,5167,7960,4670,4397,7191,4293,3747,6425,3709,3840,7642,4821,4865) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '1' > par3 = '0' > par2 = '1' > par1 = '48' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Dr. Ian E. Holliday > #To cite this work: Ian E. Holliday, 2009, 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: > #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 (par8 != '') par8 <- as.numeric(par8) > ox <- x > if (par8 == '') { + if (par2 == 0) { + x <- log(x) + } else { + x <- (x ^ par2 - 1) / par2 + } + } else { + x <- log(x,base=par8) + } > 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/1yj401292956621.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > op <- par(mfrow=c(2,1)) > plot(ox,type='l',main='Original Time Series',xlab='time',ylab='value') > if (par8=='') { + mytitle <- paste('Working Time Series (lambda=',par2,', d=',par3,', D=',par4,')',sep='') + mysub <- paste('(lambda=',par2,', d=',par3,', D=',par4,', CI=', par7, ', CI type=',par6,')',sep='') + } else { + mytitle <- paste('Working Time Series (base=',par8,', d=',par3,', D=',par4,')',sep='') + mysub <- paste('(base=',par8,', d=',par3,', D=',par4,', CI=', par7, ', CI type=',par6,')',sep='') + } > plot(x,type='l', main=mytitle,xlab='time',ylab='value') > par(op) > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/2qsl31292956621.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=mysub) > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/31jk51292956621.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',sub=mysub) > dev.off() null device 1 > (myacf <- c(racf$acf)) [1] 1.000000e+00 3.875413e-02 -2.769667e-01 1.638989e-01 1.686257e-01 [6] 8.071292e-02 7.647162e-02 1.114654e-01 6.393871e-02 7.304936e-02 [11] 2.747744e-01 9.204224e-02 -3.615972e-01 8.497184e-02 1.694396e-01 [16] 2.387911e-02 7.006270e-03 2.439498e-02 3.457574e-02 -3.734882e-02 [21] -4.934935e-02 -1.951687e-02 -1.780159e-02 -4.608936e-02 4.848366e-02 [26] -5.961687e-02 -2.903765e-02 -1.238492e-02 -9.466848e-02 -1.051925e-01 [31] -6.916755e-05 8.916913e-03 -5.937890e-02 2.615478e-03 -4.468692e-02 [36] -7.954081e-03 -3.802940e-02 -1.093332e-02 -4.031563e-02 -3.328527e-02 [41] 4.631665e-02 -1.844953e-03 -1.504515e-01 6.642885e-02 5.865807e-02 [46] -1.853463e-01 3.856740e-02 4.590967e-02 -4.632136e-02 > (mypacf <- c(rpacf$acf)) [1] 0.038754133 -0.278887419 0.204633515 0.071595386 0.183388631 [6] 0.105094607 0.149015753 0.053071843 0.090632302 0.271688638 [11] 0.074533932 -0.357591508 0.004458441 -0.239776194 0.069278440 [16] -0.071035362 0.073771969 -0.010109196 -0.008740071 -0.098595508 [21] -0.026633940 0.101000321 -0.014916987 -0.078287193 -0.071151927 [26] -0.054781973 0.034919366 -0.078418294 -0.033141011 0.041395591 [31] 0.001177996 -0.032300730 0.079050361 0.047019191 0.110677847 [36] -0.008309499 0.031801464 -0.022920758 0.031891410 -0.032310199 [41] -0.073811779 -0.193483244 0.102064305 -0.118851274 -0.085662609 [46] 0.044319347 0.048251684 -0.002853438 > 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/4421b1292956621.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/583zh1292956621.tab") > > try(system("convert tmp/1yj401292956621.ps tmp/1yj401292956621.png",intern=TRUE)) character(0) > try(system("convert tmp/2qsl31292956621.ps tmp/2qsl31292956621.png",intern=TRUE)) character(0) > try(system("convert tmp/31jk51292956621.ps tmp/31jk51292956621.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.726 0.455 1.582