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 = '1' > 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/1bqvx1259230771.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/20m9h1259230771.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.0000000000 0.3245712597 0.1395795596 0.2332974393 0.2486547265 [6] 0.2387710951 -0.0206551743 -0.0119053268 0.1587328255 0.0379018912 [11] -0.1508809060 0.0962740714 0.0141683806 0.0044398302 0.0555410344 [16] -0.0104303827 0.0579272773 -0.1224935881 -0.1958823716 -0.0005563254 [21] -0.0779055273 -0.1319773769 -0.1784490889 -0.1271027755 -0.1159109211 [26] -0.0730051315 -0.0948168973 -0.0107363696 0.0806700300 -0.0419527319 [31] -0.0539620132 -0.0783070352 -0.0477021798 -0.0692515694 -0.0868902238 [36] -0.1049960361 -0.0688285150 -0.0660134989 -0.0625825676 -0.0770319732 [41] -0.0444159267 -0.0061714086 -0.0026496639 -0.0199913486 -0.0523747548 [46] -0.0337239752 -0.0342431135 -0.0368141819 -0.0478169882 -0.0024295626 [51] 0.0123152896 0.0139117892 -0.0009270789 0.0149560036 0.0337431556 [56] 0.0297479346 0.0166716287 0.0196193612 0.0199677989 0.0103221282 > (mypacf <- c(rpacf$acf)) [1] 0.324571260 0.038264040 0.198476838 0.135744200 0.128838834 [6] -0.200019105 -0.038324249 0.109937930 -0.058704280 -0.173950263 [11] 0.256067707 -0.119780513 0.008496143 0.132178556 -0.018035714 [16] -0.096471971 -0.139569863 -0.108842464 0.029194144 -0.070556760 [21] 0.086808011 -0.154706264 0.023587773 -0.100200091 0.091752518 [26] 0.016984145 0.037234122 0.099154669 -0.030476708 -0.163901318 [31] 0.002759250 -0.071595980 -0.038839385 -0.018982920 -0.003330455 [36] -0.033562613 0.020451949 0.075567248 -0.144445705 -0.021499975 [41] 0.013825686 -0.073287134 0.017499633 -0.027666976 0.008286520 [46] -0.034632733 -0.024703032 -0.003316901 0.022155748 0.077984304 [51] 0.010012739 -0.022668043 -0.030401175 -0.074576760 0.009820296 [56] -0.064583899 -0.035485381 0.059543555 -0.013814777 > 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/3sy6z1259230771.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/4hx4q1259230771.tab") > > system("convert tmp/1bqvx1259230771.ps tmp/1bqvx1259230771.png") > system("convert tmp/20m9h1259230771.ps tmp/20m9h1259230771.png") > > > proc.time() user system elapsed 0.584 0.316 0.709