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(1579,2146,2462,3695,4831,5134,6250,5760,6249,2917,1741,2359,1511,2059,2635,2867,4403,5720,4502,5749,5627,2846,1762,2429,1169,2154,2249,2687,4359,5382,4459,6398,4596,3024,1887,2070,1351,2218,2461,3028,4784,4975,4607,6249,4809,3157,1910,2228,1594,2467,2222,3607,4685,4962,5770,5480,5000,3228,1993,2288,1580,2111,2192,3601,4665,4876,5813,5589,5331,3075,2002,2306,1507,1992,2487,3490,4647,5594,5611,5788,6204,3013,1931,2549,1504,2090,2702,2939,4500,6208,6415,5657,5964,3163,1997,2422,1376,2202,2683,3303,5202,5231,4880,7998,4977,3531,2025,2205,1442,2238,2179,3218,5139,4990,4914,6084,5672,3548,1793,2086) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '1' > par3 = '0' > 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/1v66n1291555974.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/2nfn71291555974.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.0000000000 -0.3369192553 -0.0213084547 0.2196734686 -0.0559260940 [6] 0.0684355864 0.1299509955 -0.1183691442 0.0426551033 0.1381797556 [11] -0.0165089331 0.0835924585 -0.2134005588 0.1190861161 0.2175120586 [16] -0.1207580635 -0.0832297642 0.1205860652 -0.0495200455 -0.0639650805 [21] 0.0872547228 -0.0822083588 -0.1536868612 0.2420705059 -0.1177892033 [26] -0.1474769912 0.1403648601 -0.0645213936 -0.0000187347 0.0329571650 [31] -0.0827748270 -0.0012766930 0.0630261972 -0.0835801476 -0.0498167786 [36] 0.0044647317 -0.0942418022 0.1380584502 -0.1148468195 -0.0249907534 [41] 0.0655375099 0.0135565166 -0.0413278298 0.0556285769 -0.0200260237 [46] -0.0391329037 0.1215563534 -0.0270174262 -0.1901564749 0.1695064276 [51] -0.0712727767 -0.0181442361 0.0787088736 -0.0907480232 0.0247297772 [56] 0.0362548802 -0.0617902968 -0.0362099955 -0.0027382480 -0.0641873650 [61] 0.0768731193 > (mypacf <- c(rpacf$acf)) [1] -0.336919255 -0.152087149 0.184947895 0.100154235 0.122698079 [6] 0.177935817 -0.022325011 -0.049764452 0.078319506 0.095438309 [11] 0.133412563 -0.245834932 -0.081205799 0.224445659 0.136138419 [16] -0.141195111 -0.073178499 0.013927434 -0.154714361 -0.086164479 [21] 0.088618428 -0.143346409 0.034466591 -0.058937905 -0.083085072 [26] 0.143650083 0.042569693 -0.060724907 0.007051512 0.060606067 [31] -0.057117075 0.020347962 0.077145979 -0.203158891 -0.039343622 [36] -0.039254447 0.021755999 0.027659841 0.078901603 -0.046735306 [41] 0.041933005 0.088767589 -0.008184018 0.039263171 0.057098286 [46] -0.102629068 0.062661532 -0.142764628 -0.021712344 -0.042881185 [51] 0.032077401 -0.013589628 -0.024929437 0.035519927 -0.115894414 [56] -0.063457150 -0.017819121 -0.143571335 -0.004582836 -0.057560798 > 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/3rgme1291555974.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/42p3y1291555974.tab") > > try(system("convert tmp/1v66n1291555974.ps tmp/1v66n1291555974.png",intern=TRUE)) character(0) > try(system("convert tmp/2nfn71291555974.ps tmp/2nfn71291555974.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.607 0.329 1.364