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(464,675,703,887,1139,1077,1318,1260,1120,963,996,960,530,883,894,1045,1199,1287,1565,1577,1076,918,1008,1063,544,635,804,980,1018,1064,1404,1286,1104,999,996,1015,615,722,832,977,1270,1437,1520,1708,1151,934,1159,1209,699,830,996,1124,1458,1270,1753,2258,1208,1241,1265,1828,809,997,1164,1205,1538,1513,1378,2083,1357,1536,1526,1376) > 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: Write here your technical program description (don't use hard returns!) > 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 (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/1guls1242321754.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > racf <- acf(x,par1,main='Autocorrelation',xlab='lags',ylab='ACF') > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/2w9rw1242321754.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.560217546 0.347071209 0.227413105 0.073900441 [6] -0.147590565 -0.306140442 -0.219918756 0.024048174 0.118404508 [11] 0.224745639 0.389456346 0.670245097 0.425297544 0.216397031 [16] 0.120718396 -0.038440125 -0.219873587 -0.337497590 -0.292311315 [21] -0.106289207 -0.012029368 0.073649965 0.211836519 0.419324272 [26] 0.276704252 0.109519849 0.025525246 -0.088481677 -0.209950986 [31] -0.337063716 -0.306636662 -0.143668571 -0.084177549 -0.021429147 [36] 0.084482466 0.254720043 0.166360646 0.010500857 -0.046748402 [41] -0.126681101 -0.210903601 -0.277877840 -0.280946181 -0.134208625 [46] -0.093386138 -0.046087072 0.002367700 0.143599579 > (mypacf <- c(rpacf$acf)) [1] 0.560217546 0.048425570 0.022298701 -0.105609716 -0.242903020 [6] -0.200815157 0.123858318 0.370476689 0.169556917 0.103506829 [11] 0.090707395 0.435849762 -0.252971932 -0.159938837 -0.037820106 [16] -0.109137926 -0.040448654 0.061837381 0.004709292 -0.115062491 [21] -0.020570461 -0.050804190 -0.054840140 0.060087751 -0.003923368 [26] -0.026922272 -0.037174488 0.046746057 0.061183160 -0.080113301 [31] 0.005225691 0.024595413 -0.089006138 -0.040450380 0.004947013 [36] 0.014016481 -0.074858377 -0.054292295 -0.015721402 -0.050130584 [41] 0.007686300 0.134500541 -0.039536253 -0.045036332 -0.021266664 [46] 0.006796588 -0.137141844 0.075353981 > 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/3ikwi1242321754.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/4m0r31242321754.tab") > > system("convert tmp/1guls1242321754.ps tmp/1guls1242321754.png") > system("convert tmp/2w9rw1242321754.ps tmp/2w9rw1242321754.png") > > > proc.time() user system elapsed 0.569 0.310 0.736