R version 2.8.0 (2008-10-20) 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(94.7,101.8,102.5,105.3,110.3,109.8,117.3,118.8,131.3,125.9,133.1,147,145.8,164.4,149.8,137.7,151.7,156.8,180,180.4,170.4,191.6,199.5,218.2,217.5,205,194,199.3,219.3,211.1,215.2,240.2,242.2,240.7,255.4,253,218.2,203.7,205.6,215.6,188.5,202.9,214,230.3,230,241,259.6,247.8,270.3,289.7,322.7,315,320.2,329.5,360.6,382.2,435.4,464,468.8,403,351.6) > 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: 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/1byh91229543830.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/218pt1229543830.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.032520e-01 -4.267236e-02 -1.906139e-01 -1.023230e-01 [6] -1.103619e-01 -9.446417e-02 1.028899e-01 4.314542e-02 -1.592647e-01 [11] -7.070405e-02 5.830126e-02 -8.636299e-03 -6.196056e-02 -1.239985e-01 [16] 6.447839e-02 -1.176555e-01 -1.389781e-01 -9.899640e-02 -6.936512e-02 [21] -3.237933e-02 -3.148590e-02 1.211070e-01 1.845323e-01 7.589621e-02 [26] 2.782500e-02 2.807246e-02 4.078272e-02 -5.684647e-02 -9.786153e-02 [31] -1.395530e-02 -4.616996e-02 -2.449927e-02 1.116919e-01 8.528978e-02 [36] 8.745218e-02 -5.396176e-02 -2.622472e-02 -1.025746e-02 7.505063e-03 [41] 4.064113e-02 -9.458601e-02 -8.383988e-02 -2.881422e-02 4.423480e-02 [46] 1.090818e-01 1.923913e-02 -3.699087e-02 -1.076140e-02 -2.957100e-02 [51] 2.364921e-02 -1.114732e-02 -2.118506e-02 -5.398316e-03 -2.899336e-04 [56] 1.252647e-02 6.148560e-03 1.577987e-02 9.043203e-05 -7.392644e-03 > (mypacf <- c(rpacf$acf)) [1] 0.3032519815 -0.1482692211 -0.1472754522 0.0004745236 -0.1172540338 [6] -0.0737292694 0.1494257958 -0.0943141250 -0.2075823902 0.0953303055 [11] 0.0324398058 -0.1439780054 0.0066713794 -0.1491931229 0.0818368464 [16] -0.1782500556 -0.1179437295 -0.1113177964 -0.1367056287 -0.0569970324 [21] -0.0955587839 -0.0126148204 0.0511485453 -0.0170063095 -0.0245094222 [26] -0.0034080305 0.0400679894 -0.1357717733 -0.0472373337 -0.0912617804 [31] -0.1243407864 -0.0314898531 0.0488127988 -0.1325760240 0.0422659694 [36] -0.0625026797 -0.0686479832 -0.0166430105 0.0555708803 -0.0182872202 [41] -0.1488617923 -0.0115339725 0.0215007032 -0.0176313299 0.0385297299 [46] -0.1248461195 -0.0870413378 0.0160199823 -0.0167605340 -0.1113355304 [51] 0.0011876088 -0.0231889431 0.0024473375 0.0512669766 -0.0834727838 [56] -0.0086679856 0.0088855917 -0.0645175782 -0.0155957376 > 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/36y2o1229543830.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/4sbbe1229543830.tab") > > system("convert tmp/1byh91229543830.ps tmp/1byh91229543830.png") > system("convert tmp/218pt1229543830.ps tmp/218pt1229543830.png") > > > proc.time() user system elapsed 0.674 0.356 1.413