R version 2.8.0 (2008-10-20) Copyright (C) 2008 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(227.86 + ,198.24 + ,194.97 + ,184.88 + ,196.79 + ,205.36 + ,226.72 + ,226.05 + ,202.50 + ,194.79 + ,192.43 + ,219.25 + ,217.47 + ,192.34 + ,196.83 + ,186.07 + ,197.31 + ,215.02 + ,242.67 + ,225.17 + ,206.69 + ,197.75 + ,196.43 + ,213.55 + ,222.75 + ,194.03 + ,201.85 + ,189.50 + ,206.07 + ,225.59 + ,247.91 + ,247.64 + ,213.01 + ,203.01 + ,200.26 + ,220.50 + ,237.90 + ,216.94 + ,214.01 + ,196.00 + ,208.37 + ,232.75 + ,257.46 + ,267.69 + ,220.18 + ,210.61 + ,209.59 + ,232.75 + ,232.75 + ,219.82 + ,226.74 + ,208.04 + ,220.12 + ,235.69 + ,257.05 + ,258.69 + ,227.15 + ,219.91 + ,219.30 + ,259.04 + ,237.29 + ,212.88 + ,226.03 + ,211.07 + ,222.91 + ,249.18 + ,266.38 + ,268.53 + ,238.02 + ,224.69 + ,213.75 + ,237.43 + ,248.46 + ,210.82 + ,221.40 + ,209.00 + ,234.37 + ,248.43 + ,271.98 + ,268.11 + ,233.88 + ,223.43 + ,221.38 + ,233.76 + ,243.97 + ,217.76 + ,224.66 + ,210.84 + ,220.35 + ,236.84 + ,266.15 + ,255.20 + ,234.76 + ,221.29 + ,221.26 + ,244.13 + ,245.78 + ,224.62 + ,234.80 + ,211.37 + ,222.39 + ,249.63 + ,282.29 + ,279.13 + ,236.60 + ,223.62 + ,225.86 + ,246.41 + ,261.70 + ,225.01 + ,231.54 + ,214.82 + ,227.70 + ,263.86 + ,278.15 + ,274.64 + ,237.66 + ,227.97 + ,224.75 + ,242.91 + ,253.08 + ,228.13 + ,233.68 + ,217.38 + ,236.38 + ,256.08 + ,292.83 + ,304.71 + ,245.57 + ,234.41 + ,234.12 + ,258.17 + ,268.66 + ,245.31 + ,247.47 + ,226.25 + ,251.67 + ,268.79 + ,288.94 + ,290.16 + ,250.69 + ,240.80) > 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/freestat/rcomp/tmp/1mhs71272545465.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/freestat/rcomp/tmp/2mhs71272545465.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.000000000 0.674595609 0.275832240 0.022735422 0.102027097 [6] 0.384065821 0.464960264 0.392595350 0.098375426 -0.006866012 [11] 0.196706846 0.532431348 0.796580328 0.525917270 0.156970324 [16] -0.085483771 -0.019343403 0.227624380 0.313804228 0.265774735 [21] 0.007685791 -0.095582051 0.080600565 0.385135514 0.618567818 [26] 0.388445910 0.059916849 -0.160362102 -0.104848123 0.130048731 [31] 0.201690534 0.166261067 -0.062622800 -0.160365717 -0.001432039 [36] 0.269968868 0.476625931 0.264685843 -0.023886100 -0.202822836 [41] -0.169248655 0.033043346 0.092925477 0.072155195 -0.113114733 [46] -0.193447372 -0.055190266 0.179239348 0.363624943 > (mypacf <- c(rpacf$acf)) [1] 0.674595609 -0.328941393 -0.005443293 0.359596896 0.342616656 [6] -0.166339754 0.142206496 -0.239727848 0.220890335 0.365052256 [11] 0.321373634 0.357153814 -0.490969782 -0.054022981 -0.022641355 [16] -0.121310445 -0.205038786 -0.009285397 0.036875509 0.029606489 [21] -0.006149909 0.066149983 0.085341385 0.055210751 -0.086355489 [26] 0.048014004 0.028052783 -0.061464810 0.040715862 -0.167200725 [31] 0.028426190 -0.016296841 -0.041780668 -0.001767712 0.013807684 [36] -0.014076864 -0.044746566 0.066058418 0.093720811 -0.166080646 [41] -0.032162533 0.034584602 0.015628712 0.021141000 -0.026789783 [46] -0.013501681 0.049925379 0.012894058 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/html/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/30qpg1272545465.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/freestat/rcomp/tmp/4b0oj1272545465.tab") > > try(system("convert tmp/1mhs71272545465.ps tmp/1mhs71272545465.png",intern=TRUE)) character(0) > try(system("convert tmp/2mhs71272545465.ps tmp/2mhs71272545465.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.816 0.440 0.951