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(106.7,110.2,125.9,100.1,106.4,114.8,81.3,87,104.2,108,105,94.5,92,95.9,108.8,103.4,102.1,110.1,83.2,82.7,106.8,113.7,102.5,96.6,92.1,95.6,102.3,98.6,98.2,104.5,84,73.8,103.9,106,97.2,102.6,89,93.8,116.7,106.8,98.5,118.7,90,91.9,113.3,113.1,104.1,108.7,96.7,101,116.9,105.8,99,129.4,83,88.9,115.9,104.2,113.4,112.2,100.8,107.3,126.6,102.9,117.9,128.8,87.5,93.8,122.7,126.2,124.6,116.7,115.2,111.1,129.9,113.3,118.5,137.9,103.6,101.7,127.4,137.5,128.3,118.2,117.1,124.2,126,132.1) > 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/freestat/rcomp/tmp/13mov1228845683.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/freestat/rcomp/tmp/2majp1228845683.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.00000000 -0.29069715 -0.44292817 0.36012499 -0.20960001 -0.10642377 [7] 0.39320254 -0.13136433 -0.14563137 0.29126050 -0.39765411 -0.17835478 [13] 0.72757128 -0.18440577 -0.36239742 0.27822112 -0.16905150 -0.09386441 [19] 0.32355714 -0.09833320 -0.11421736 0.25378178 -0.37014087 -0.08079608 [25] 0.53548147 -0.16254122 -0.22753809 0.19246951 -0.13937378 -0.06445733 [31] 0.24489451 -0.08285848 -0.05763281 0.15320135 -0.25912036 -0.09450229 [37] 0.42499934 -0.09814574 -0.19913141 0.15479689 -0.11096585 -0.04947801 [43] 0.16741087 -0.03727177 -0.02572450 0.09241973 -0.20657391 -0.07238869 [49] 0.33718426 -0.04789259 -0.18304988 0.11420911 -0.07399158 -0.02692355 [55] 0.10348935 -0.01963769 -0.01771562 0.06887485 -0.15328611 -0.06082671 [61] 0.25954429 > (mypacf <- c(rpacf$acf)) [1] -0.2906971537 -0.5761177426 -0.0168213936 -0.4981414682 -0.3192085755 [6] -0.1566605714 -0.1132706418 -0.0093783751 0.3682212244 -0.2019364798 [11] -0.4479180645 0.1474942222 0.1558196623 0.1315898156 0.0016079931 [16] 0.0402330823 0.0327852483 -0.0600978066 -0.0199077460 -0.0773465558 [21] 0.0848792776 -0.0854989220 0.1561054579 0.0023964608 0.0474815383 [26] 0.0403384704 0.0570204310 0.0827881906 0.0642174312 0.0508057609 [31] 0.0351165658 0.0331082777 -0.0968946532 0.0475034222 -0.2107146423 [36] -0.0253406156 -0.0448812470 -0.0019518856 -0.0109986397 -0.0323026651 [41] 0.0747813287 -0.1254145919 0.0487549077 -0.0778721644 0.0748792598 [46] -0.1089760632 -0.0283547562 0.0025346189 0.0035758160 0.0125715267 [51] -0.0509872035 0.0411284810 0.0380400088 0.1217846741 -0.0128747910 [56] 0.0007704714 -0.0723755069 0.0246332395 0.0547244491 -0.0279772718 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/html/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/3ogrg1228845683.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/freestat/rcomp/tmp/4q4v31228845683.tab") > system("convert tmp/13mov1228845683.ps tmp/13mov1228845683.png") > system("convert tmp/2majp1228845683.ps tmp/2majp1228845683.png") > > > proc.time() user system elapsed 0.822 0.446 1.004