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(93.7,105.7,109.5,105.3,102.8,100.6,97.6,110.3,107.2,107.2,108.1,97.1,92.2,112.2,111.6,115.7,111.3,104.2,103.2,112.7,106.4,102.6,110.6,95.2,89,112.5,116.8,107.2,113.6,101.8,102.6,122.7,110.3,110.5,121.6,100.3,100.7,123.4,127.1,124.1,131.2,111.6,114.2,130.1,125.9,119,133.8,107.5,113.5,134.4,126.8,135.6,139.9,129.8,131,153.1,134.1,144.1,155.9,123.3,128.1,144.3,153,149.9,150.9,141,138.9,157.4,142.9,151.7,161,138.5,135.9,151.5,164,159.1,157,142.1,144.8,152.1,154.6,148.7,157.7,146.4,136.5) > par5 = '12' > par4 = '0' > par3 = '0' > 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/1kd661228860291.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/2aqj21228860291.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.0000000000 0.8183693758 0.7325097999 0.7732115320 0.6970128039 [6] 0.7243389834 0.8025451785 0.6716751681 0.6089280899 0.6338910075 [11] 0.5260684261 0.5683842337 0.6661544208 0.5112532411 0.4311426231 [16] 0.4474608472 0.3689899743 0.3905804093 0.4494484953 0.3225273826 [21] 0.2673658656 0.2698481862 0.1655920035 0.2010590316 0.2611084560 [26] 0.1287305415 0.0640267354 0.0641698466 -0.0245378934 -0.0008937296 [31] 0.0222701601 -0.0753804338 -0.1128563357 -0.1310902004 -0.2055725184 [36] -0.1617181819 -0.1144699426 -0.2087138850 -0.2429253335 -0.2442653343 [41] -0.2889366424 -0.2621032106 -0.2392952898 -0.2986034917 -0.3135752947 [46] -0.3283832384 -0.3837278324 -0.3447888431 -0.3179047085 -0.3657251800 [51] -0.3822016526 -0.3898956724 -0.4025959499 -0.3753838216 -0.3531060518 [56] -0.3731738015 -0.3615656187 -0.3677649476 -0.3784133888 -0.3355174671 [61] -0.3124275584 > (mypacf <- c(rpacf$acf)) [1] 0.8183693758 0.1900901298 0.4150819074 -0.1209665296 0.3822923414 [6] 0.2489354703 -0.3178944239 -0.0739315965 -0.0352108706 -0.2414738440 [11] 0.2732417509 0.2045050210 -0.3509152436 -0.1498139915 -0.0165724682 [16] 0.0899547286 -0.0514691126 -0.0061516646 -0.0102981052 -0.0553250852 [21] -0.0818665058 -0.0171790243 0.0348389536 -0.0803698689 -0.0724161850 [26] -0.0073175644 -0.0309030878 -0.1019574731 0.0008859537 -0.1440691439 [31] 0.1506465215 -0.0631092345 -0.0535844488 0.1156029801 0.0160690470 [36] 0.0320096087 -0.0222661199 -0.0169513392 0.0437621498 0.0235359066 [41] -0.1186568650 0.0364364454 -0.0404156082 -0.0060379179 -0.0311700338 [46] -0.0523345068 -0.0604986959 -0.0708536501 0.1240449316 -0.0190778660 [51] -0.0197982867 0.0463553019 -0.0283670627 0.0595338122 -0.0100319553 [56] 0.0403140598 0.0369835718 -0.0482489774 0.0574124047 -0.0689671118 > 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/3tehi1228860291.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/4e4z21228860291.tab") > > system("convert tmp/1kd661228860291.ps tmp/1kd661228860291.png") > system("convert tmp/2aqj21228860291.ps tmp/2aqj21228860291.png") > > > proc.time() user system elapsed 0.565 0.315 1.161