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(104.9,110.9,104.8,94.1,95.8,99.3,101.1,104.0,99.0,105.4,107.1,110.7,117.1,118.7,126.5,127.5,134.6,131.8,135.9,142.7,141.7,153.4,145.0,137.7,148.3,152.2,169.4,168.6,161.1,174.1,179.0,190.6,190.0,181.6,174.8,180.5,196.8,193.8,197.0,216.3,221.4,217.9,229.7,227.4,204.2,196.6,198.8,207.5,190.7,201.6,210.5,223.5,223.8,231.2,244.0,234.7,250.2,265.7,287.6,283.3,295.4,312.3,333.8,347.7,383.2,407.1,413.6,362.7,321.9,239.4,191.0,159.7,166.7) > par5 = '12' > par4 = '1' > 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/1ewvg1242301542.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/2blzm1242301542.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.832983906 0.570993419 0.280832462 0.034708527 [6] -0.127918164 -0.215636967 -0.243070035 -0.256486793 -0.268654358 [11] -0.282033920 -0.288279705 -0.297645949 -0.264833761 -0.216516069 [16] -0.135344331 -0.073083327 -0.024910244 -0.003987472 0.021566342 [21] 0.051950298 0.072286899 0.079779345 0.086384129 0.094061413 [26] 0.084533580 0.082737775 0.056061238 0.019911884 -0.014060358 [31] -0.024608385 -0.012124937 -0.010293397 0.003836810 0.011254861 [36] 0.008457687 0.015599074 0.016963203 0.011441643 -0.004040967 [41] -0.019640531 -0.012830339 -0.005699407 -0.007163134 -0.007640647 [46] -0.016618462 -0.010668447 -0.009664699 -0.025430678 > (mypacf <- c(rpacf$acf)) [1] 0.8329839062 -0.4013511688 -0.2000230939 -0.0328450440 0.0180917658 [6] -0.0460021640 -0.0387620587 -0.1335008517 -0.0914517356 -0.0714042333 [11] -0.0560163508 -0.1368149612 0.0531703845 -0.0883842682 0.0358151812 [16] -0.1453254225 -0.0280229774 -0.0937354452 0.0705737236 -0.0347938438 [21] -0.0672548894 -0.0892399857 0.0414770632 -0.0213869204 -0.0505762216 [26] 0.0027220757 -0.0892189098 -0.0660681343 0.0198120221 -0.0004320524 [31] 0.0217616552 -0.1188507399 0.0772151368 -0.0571166213 -0.0166134520 [36] 0.0396493651 -0.0320756024 -0.0251262562 -0.0489411288 -0.0036029705 [41] 0.0516935039 -0.0259087458 -0.0438596664 -0.0015384546 -0.0086738263 [46] 0.0307983033 -0.0419462748 -0.0829745493 > 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/3tasx1242301542.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/4cxko1242301542.tab") > > system("convert tmp/1ewvg1242301542.ps tmp/1ewvg1242301542.png") > system("convert tmp/2blzm1242301542.ps tmp/2blzm1242301542.png") > > > proc.time() user system elapsed 0.575 0.314 0.884