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(104.3,119.8,116.8,118.2,107.4,110.8,94.8,96.5,113.4,109.8,118.7,117.2,110.3,111.6,128.1,121.3,107.3,120.5,98.5,97.7,113.2,114.6,118.3,123.9,113.6,117.5,130.1,124.7,114.2,127.3,105.9,101.5,120.2,117.1,131.1,130,120.6,123.1,135.3,134.1,123.7,134.6,108.3,110.4,127.8,126.6,131.4,141.1,127,127.3,143.6,149.4,126.6,136.5,116,118,131.4,140.7,144.9,143.9,127.1) > par5 = '12' > par4 = '1' > par3 = '0' > par2 = '-0.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/1nvcz1229625216.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/2nidj1229625216.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.167532466 -0.056632944 0.144549223 0.140095243 [6] -0.120153527 0.167539873 0.291567304 -0.091862731 0.023765773 [11] -0.034983571 0.217515107 -0.184500351 0.094661317 0.022529618 [16] -0.016230999 -0.083966085 0.007998548 -0.009557505 -0.112628774 [21] 0.060673431 -0.194979901 0.062433227 -0.025688771 -0.050007214 [26] -0.115112500 0.020371925 -0.037517184 -0.052080574 -0.008532050 [31] -0.040748753 -0.100847753 -0.175809238 0.170476277 -0.005598076 [36] -0.149306756 -0.023523316 0.043864414 -0.166737737 -0.016657433 [41] 0.176420943 -0.014078947 -0.128135364 0.063398324 -0.035418040 [46] -0.098319689 0.028155452 0.089288481 -0.008156231 > (mypacf <- c(rpacf$acf)) [1] -0.167532466 -0.087146009 0.124031469 0.191619144 -0.048416051 [6] 0.143922635 0.324613377 0.047933568 0.031980562 -0.186272849 [11] 0.147187062 -0.142119475 -0.053052698 -0.111760346 -0.046655298 [16] -0.025195215 -0.068381738 -0.092144114 -0.038314790 0.034619854 [21] -0.155116770 -0.002198232 0.104303502 0.013258820 -0.029858878 [26] -0.032795982 0.060630259 0.092375392 -0.057589094 -0.051354461 [31] -0.151639471 -0.143403636 0.057030310 0.047140579 -0.099999845 [36] -0.055813405 0.003241972 -0.019506949 0.004263476 0.087230364 [41] 0.132293257 -0.009820326 0.086025269 -0.105807106 -0.067566807 [46] -0.069162695 -0.072777825 -0.036923548 > 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/310o21229625216.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/4hnr81229625216.tab") > > system("convert tmp/1nvcz1229625216.ps tmp/1nvcz1229625216.png") > system("convert tmp/2nidj1229625216.ps tmp/2nidj1229625216.png") > > > proc.time() user system elapsed 0.596 0.337 0.731