R version 2.7.0 (2008-04-22) 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(124.1,110.7,128.1,108.9,111.2,131.9,120.5,115.4,130.8,112.6,111.1,129.5,131.8,127.7,142.6,115.8,119.5,139.8,130.6,126.2,141.7,118.9,120.3,141.2,138.9,141.3,153.7,131,136.5,160.1,139.8,143.8,155.8,131,131.8,151.7,153.8,152.9,156.1,147.2,145.7,165.3,147.4,154.4,165.3,145.2,139.7,158.4,169.1,162.1,166.2,157.2,161.4,169,171.8,161.4,175.7,164.7,146.1,173) > 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/1mdyv1229702614.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/255941229702614.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.679773490 0.610625368 0.751688076 0.537075943 [6] 0.534666213 0.691071710 0.465098361 0.388155723 0.495224260 [11] 0.291981314 0.309110542 0.474981694 0.246654167 0.176210111 [16] 0.313078304 0.130128220 0.099927232 0.248609310 0.058685734 [21] -0.002049848 0.070463239 -0.080076925 -0.082388205 0.031666790 [26] -0.126088047 -0.179100561 -0.065103229 -0.197515963 -0.222444056 [31] -0.101537395 -0.225106825 -0.282521149 -0.217215868 -0.311114470 [36] -0.331558544 -0.247818383 -0.328664729 -0.350638081 -0.264740626 [41] -0.334347967 -0.339522054 -0.255586712 -0.310483074 -0.333007512 [46] -0.265048623 -0.313950519 -0.327610467 -0.277670849 -0.288242031 [51] -0.274281372 -0.206660026 -0.221990694 -0.210912175 -0.140332813 [56] -0.140824375 -0.120164356 -0.048420745 -0.052371333 -0.027765197 > (mypacf <- c(rpacf$acf)) [1] 0.6797734899 0.2761315495 0.5303208062 -0.2589832076 0.1754944240 [6] 0.2598134035 -0.2408172209 -0.1968594267 0.0061099659 -0.1320054364 [11] 0.1754234646 0.2009895589 -0.1883544680 -0.1865551723 0.1119507743 [16] 0.0112091929 -0.1184689925 -0.0459885890 -0.0301925922 0.0090396856 [21] -0.1783482706 0.0347485680 0.0302382173 -0.0176689055 0.0003770691 [26] -0.0458792501 0.0405873487 -0.0016554843 -0.0511428064 -0.0682474527 [31] -0.0411967805 -0.0228921689 -0.1087964709 -0.0063387821 -0.0424922331 [36] -0.0210311543 0.0948533142 0.0507933609 0.0159784420 -0.0285403961 [41] 0.0416241110 -0.1087505307 -0.0713535223 0.0109532996 -0.0144135840 [46] -0.0791584531 -0.0390984776 -0.0194519457 0.1537729494 0.0890617184 [51] 0.0902861517 -0.0386078572 0.0407355938 0.0387319333 -0.0332685397 [56] -0.0617109078 -0.0136351994 0.0063839796 0.1276521822 > 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/3g8661229702614.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/45mft1229702614.tab") > > system("convert tmp/1mdyv1229702614.ps tmp/1mdyv1229702614.png") > system("convert tmp/255941229702614.ps tmp/255941229702614.png") > > > proc.time() user system elapsed 1.543 0.560 1.650