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(785.8,819.3,849.4,880.4,900.1,937.2,948.9,952.6,947.3,974.2,1000.8,1032.8,1050.7,1057.3,1075.4,1118.4,1179.8,1227,1257.8,1251.5,1236.3,1170.6,1213.1,1265.5,1300.8,1348.4,1371.9,1403.3,1451.8,1474.2,1438.2,1513.6,1562.2,1546.2,1527.5,1418.7,1448.5,1492.1,1395.4,1403.7,1316.6,1274.5,1264.4,1323.9,1332.1,1250.2,1096.7,1080.8,1039.2,792,746.6,688.8,715.8,672.9,629.5,681.2,755.4,760.6,765.9,836.8,904.9) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '2' > 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/html/rcomp/tmp/1iysb1259231739.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/2dr5x1259231739.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.000000e+00 -3.707523e-01 -1.943032e-01 6.056158e-02 -1.433703e-04 [6] 1.969162e-01 -1.779607e-01 -1.212444e-01 1.990161e-01 7.249997e-02 [11] -3.327597e-01 3.007964e-01 -1.040897e-01 -5.359240e-02 1.199234e-01 [16] -1.210273e-01 1.673267e-01 -9.166890e-02 -1.813543e-01 2.149187e-01 [21] -4.728371e-04 -4.204526e-02 -4.876765e-02 -2.410296e-03 -2.197848e-02 [26] 8.625525e-02 -1.031089e-01 -8.109563e-03 1.486364e-01 -8.355854e-02 [31] 2.394156e-02 -5.276484e-02 4.036408e-02 1.442249e-03 1.259579e-02 [36] -6.337265e-02 2.657444e-02 1.147220e-02 3.448005e-03 2.370491e-03 [41] -2.215756e-02 2.018672e-02 -1.617870e-03 1.321028e-02 -3.180049e-02 [46] 2.698074e-02 -8.648620e-03 1.207585e-02 -2.178266e-02 -4.372319e-03 [51] 1.247757e-02 2.274013e-03 -7.144211e-03 -4.531791e-03 4.031890e-03 [56] -2.066862e-03 2.341113e-04 -9.735745e-04 5.050484e-05 > (mypacf <- c(rpacf$acf)) [1] -0.370752306 -0.384630786 -0.247351269 -0.223785159 0.117863668 [6] -0.028374561 -0.155249817 0.008161133 0.145674121 -0.300690626 [11] 0.179705881 -0.021333535 -0.126133610 0.037089084 0.089659874 [16] 0.051644831 0.017070255 -0.113817568 0.006694915 -0.110524408 [21] 0.166635216 -0.094183291 -0.002588777 -0.180519722 -0.066197943 [26] -0.104216465 -0.110247588 0.010943923 0.148827923 -0.071283146 [31] 0.079057643 0.015697662 -0.008532372 -0.022464130 0.013970137 [36] -0.096094723 -0.069993500 0.126654789 0.003524814 -0.060208729 [41] 0.056885953 -0.079810728 -0.026692379 -0.021293256 0.025524192 [46] -0.009615561 0.006477885 -0.033886923 -0.083919813 -0.024997913 [51] 0.022312485 0.010495565 0.022534993 -0.030960906 0.042828831 [56] -0.009012111 -0.080073914 -0.011968477 > 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/3mdc01259231739.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/4iy561259231739.tab") > > system("convert tmp/1iysb1259231739.ps tmp/1iysb1259231739.png") > system("convert tmp/2dr5x1259231739.ps tmp/2dr5x1259231739.png") > > > proc.time() user system elapsed 0.605 0.303 1.250