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(200.7,146.5,143.6,141.5,137.5,138.7,135.5,136.4,112.1,109,123.8,151.2,139.2,115.7,147.6,126.1,122.8,137.3,142,137.4,89.4,108,117.7,127.3,121,104.1,119.5,116.7,96.1,125,118.8,114.9,79.3,90.5,87.8,109.4,88.9,97.4,112,86.8,82.9,105.2,89.1,85.5,87.1,85.2,88.2,104,96.4,82.3,114.1,88.9,93.6,101.8,96.6,93.7,68.4,68.7,81.2,85.1,75.4,71.6,83,72.3,90.2,89,84.9,90.9,46.6,55.4,88.7,76,76.9,72.1,90,92.3,78,93.9,84.5,80.4,60.5,75.3,91.5,105.2,92.7) > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '1' > par1 = '36' > #'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/1hqc01228248915.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/2sav81228248915.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.694871089 0.598578615 0.596587287 0.584859862 [6] 0.566949455 0.509006911 0.526987609 0.480098839 0.420774751 [11] 0.434358003 0.519652884 0.554851979 0.387166547 0.352010957 [16] 0.311819359 0.295067675 0.306961882 0.236381322 0.231870160 [21] 0.151011289 0.131896827 0.128507793 0.183156317 0.188247072 [26] 0.069489287 0.057417971 0.032256326 -0.007378019 0.035173488 [31] -0.042621343 -0.055071679 -0.108871449 -0.101697135 -0.108837041 [36] -0.051950831 -0.045696887 > (mypacf <- c(rpacf$acf)) [1] 0.694871089 0.223787782 0.240669139 0.154978145 0.112294415 [6] -0.010898322 0.121382178 -0.039014827 -0.060819300 0.061758325 [11] 0.240291837 0.176783181 -0.270201513 -0.101333566 -0.177079431 [16] -0.041361042 0.080807602 -0.088246512 -0.011690368 -0.093516619 [21] 0.016892641 -0.089777853 0.070583944 0.059436900 -0.074956770 [26] 0.020271523 -0.019815013 -0.150001438 0.099386175 -0.092287478 [31] -0.004601573 0.006494164 0.056152365 -0.087796603 0.090355531 [36] 0.045147432 > 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/3rz351228248915.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/4nyhg1228248915.tab") > > system("convert tmp/1hqc01228248915.ps tmp/1hqc01228248915.png") > system("convert tmp/2sav81228248915.ps tmp/2sav81228248915.png") > > > proc.time() user system elapsed 0.533 0.318 0.656