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(62.027,56.493,65.566,62.653,53.470,59.600,42.542,42.018,44.038,44.988,43.309,26.843,69.770,64.886,79.354,63.025,54.003,55.926,45.629,40.361,43.039,44.570,43.269,25.563,68.707,60.223,74.283,61.232,61.531,65.305,51.699,44.599,35.221,55.066,45.335,28.702,69.517,69.240,71.525,77.740,62.107,65.450,51.493,43.067,49.172,54.483,38.158,27.898,58.648,56.000,62.381,59.849,48.345,55.376,45.400,38.389,44.098,48.290,41.267,31.238) > 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/18klz1291379063.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/html/rcomp/tmp/28klz1291379063.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.405229950 0.230213430 0.043007309 -0.172785879 [6] -0.300800096 -0.538866836 -0.354902316 -0.253523712 -0.065903820 [11] 0.104602172 0.275215959 0.739235889 0.306958168 0.175854915 [16] 0.046107289 -0.155085588 -0.275850627 -0.504319012 -0.333315707 [21] -0.275401638 -0.136206406 -0.011518335 0.140885249 0.508374815 [26] 0.250239817 0.150267769 0.085688699 -0.077954090 -0.157008426 [31] -0.294469815 -0.184665536 -0.169145010 -0.121050483 -0.003704931 [36] 0.079649037 0.323994239 0.180488172 0.115419122 0.081148554 [41] 0.002407356 -0.042519561 -0.119029992 -0.082783331 -0.088826372 [46] -0.066149606 -0.014751069 0.010728742 0.127243087 > (mypacf <- c(rpacf$acf)) [1] 4.052299e-01 7.896986e-02 -9.019756e-02 -2.167016e-01 -1.970977e-01 [6] -4.071000e-01 -2.334743e-02 -5.645415e-02 3.868178e-02 1.440977e-02 [11] 1.092047e-01 6.149003e-01 -3.400518e-01 -1.816006e-01 -2.019255e-02 [16] -5.388804e-02 -4.265141e-02 -7.361993e-04 4.850916e-02 -9.126891e-02 [21] -1.110279e-01 -1.512788e-01 -1.137439e-01 -9.878559e-02 9.489710e-02 [26] -4.062397e-02 -1.429124e-02 -3.215688e-02 2.795680e-02 1.872317e-01 [31] -7.352136e-03 -3.927494e-03 -9.397830e-02 9.385776e-02 -6.532919e-02 [36] -1.073646e-01 2.708470e-02 5.093362e-02 -8.702658e-02 8.642834e-02 [41] 3.560146e-02 -5.271359e-02 -7.829447e-02 -4.360284e-05 1.376966e-01 [46] -1.127363e-01 4.053002e-02 -2.589644e-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/3mcj81291379063.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/4pvhw1291379063.tab") > > try(system("convert tmp/18klz1291379063.ps tmp/18klz1291379063.png",intern=TRUE)) character(0) > try(system("convert tmp/28klz1291379063.ps tmp/28klz1291379063.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.575 0.330 1.246