R version 2.7.0 (2008-04-22) 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(95.1,95.9,95.9,96.9,95.7,97.8,95.9,98.2,101.2,106.8,108.2,108.2,113.2,115.2,122,119.8,119.8,112.7,113.8,118.6,119.2,118.1,121.6,125.3,126.5,133.6,136.5,131.9,131.9,139.3,139.9,140.1,142.1,141.8,143.5,143.6,140.6,137.4,133.9,134.6,134.6,132.1,132.5,134.1,135.1,136.4,136.6,138.1,138.4,141,144.9,153.4,156.5,160.7,163.9,166.7,169.7,174.3,181.8,187.8,182.4) > par5 = '12' > par4 = '0' > par3 = '1' > par2 = '-0.8' > 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/1rss31229877633.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/25rm51229877633.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.124119427 0.015548135 -0.038487713 0.145565671 [6] 0.008110647 0.059997864 0.024635982 -0.395422532 -0.079759717 [11] 0.080783619 0.172757480 -0.207198076 -0.072447477 -0.057287744 [16] -0.039959544 -0.005080044 -0.003150193 -0.111051915 -0.104781956 [21] 0.101316178 0.070899960 -0.006527723 -0.082441321 -0.023135692 [26] -0.009549723 -0.014048468 -0.056483000 -0.073021493 -0.038611364 [31] -0.031838143 -0.035106599 0.004877739 0.022518721 -0.076694173 [36] -0.021485938 -0.024801289 0.029514948 -0.003189165 0.075341824 [41] 0.016903894 -0.045815208 0.056620950 0.106484237 0.079580407 [46] 0.046180789 -0.001846618 -0.027345562 -0.026023831 > (mypacf <- c(rpacf$acf)) [1] 0.1241194275 0.0001447323 -0.0410679010 0.1580555264 -0.0306814033 [6] 0.0600390497 0.0252872721 -0.4480564394 0.0612359099 0.1088935845 [11] 0.1081539462 -0.1387925626 -0.0633050171 -0.0005243232 -0.0553881953 [16] -0.1349503176 -0.0288227805 -0.0231368188 0.1085556590 -0.0073751935 [21] -0.0336041814 -0.0157492626 -0.0670773516 -0.0887974532 -0.0161662657 [26] -0.0769832288 -0.0518897303 -0.0053118562 0.0280304425 -0.0799364442 [31] -0.1457483987 -0.0006469532 0.0637319594 -0.1374001239 -0.0801452861 [36] -0.0798290679 0.0968342159 -0.0012993695 -0.0695018318 -0.0292002903 [41] -0.0363282043 0.0074460920 0.0033377588 -0.0361849490 0.1362211670 [46] -0.0929669006 -0.0310964738 -0.0824462911 > 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/3suuy1229877633.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/4qdnv1229877633.tab") > > system("convert tmp/1rss31229877633.ps tmp/1rss31229877633.png") > system("convert tmp/25rm51229877633.ps tmp/25rm51229877633.png") > > > proc.time() user system elapsed 1.528 0.555 1.615