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(103.3,107.9,101,94.6,94.2,92.3,107.1,102.6,103.1,104.1,92.7,87,109.3,113.9,103.3,100.8,97.4,98.9,110.8,103.5,99.8,104.9,95.2,85.7,110,113.7,101.1,103.6,96.2,98.3,119.7,109.4,103.5,118.2,98.7,96.8,121.8,124,119.6,122.5,109.7,111.6,131.2,124.4,116.9,131.8,107.4,111,134,126.2,131.2,130.1,123.1,126.3,148.6,130.1,142.3,154.4,121.6,124.8,143.6,146.9,144.6,137.1,134.7,130.8,153.5,137.6,146.5,156.7,137.6,131.4,147.4,158.5,151.5,142.5,131.3,133.4,136.9,143.2,136.4,145.9,138.8,122.9) > 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/freestat/rcomp/tmp/1awe81230131462.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/2xlls1230131462.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.801356798 0.699660059 0.753578589 0.687625030 [6] 0.723547343 0.799887545 0.684366699 0.617777691 0.625531783 [11] 0.500571066 0.554067284 0.672037829 0.514341942 0.419332534 [16] 0.435377635 0.359171734 0.383864198 0.435999353 0.322515701 [21] 0.264615364 0.241452917 0.124416107 0.171162269 0.235445819 [26] 0.115958489 0.042185652 0.025482618 -0.052758149 -0.032919066 [31] -0.005995297 -0.078390874 -0.117144894 -0.163917686 -0.240005757 [36] -0.201984571 -0.150521299 > (mypacf <- c(rpacf$acf)) [1] 0.801356798 0.160656672 0.442450430 -0.087119351 0.428376775 [6] 0.204413961 -0.162326783 -0.092647605 -0.121109267 -0.401165618 [11] 0.278223367 0.211293388 -0.289042733 -0.163173170 0.013026365 [16] 0.067677276 0.014587165 -0.077876033 -0.017285041 -0.098633020 [21] -0.119029708 -0.001509393 0.054617208 -0.168081775 0.033977751 [26] -0.029172926 0.012118756 -0.064843102 -0.020584179 -0.077456594 [31] 0.138273481 -0.114700194 0.003713223 0.033963693 -0.040744564 [36] 0.063729572 > 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/3o7hh1230131462.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/4hci51230131462.tab") > > system("convert tmp/1awe81230131462.ps tmp/1awe81230131462.png") > system("convert tmp/2xlls1230131462.ps tmp/2xlls1230131462.png") > > > proc.time() user system elapsed 0.748 0.421 0.902