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(101.6,101.8,102.1,102.1,101.9,102.1,102,102.1,102.2,102.3,102.7,102.8,103.1,103.1,103.3,103.5,103.3,103.5,103.8,103.9,103.9,104.2,104.6,104.9,105.2,105.2,105.6,105.6,106.2,106.3,106.4,106.9,107.2,107.3,107.3,107.4,107.55,107.87,108.37,108.38,107.92,108.03,108.14,108.3,108.64,108.66,109.04,109.03,109.03,109.54,109.75,109.83,109.65,109.82,109.95,110.12,110.15,110.2,109.99,110.14,110.14,110.81,110.97,110.99,109.73,109.81,110.02,110.18,110.21,110.25,110.36,110.51,110.64,110.95,111.18,111.19,111.69,111.7,111.83,111.77,111.73,112.01,111.86,112.04) > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '1' > par1 = '48' > #'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/182by1228767672.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/24b7s1228767672.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.96634637 0.93348035 0.90068905 0.86904969 0.83443616 [7] 0.79871303 0.76116471 0.72245402 0.68554478 0.64880158 0.61440055 [13] 0.58059414 0.54783965 0.51416452 0.48161709 0.44955357 0.41470331 [19] 0.38067141 0.34832868 0.31618991 0.27675013 0.23838333 0.20241717 [25] 0.17007055 0.13760177 0.10478105 0.07308676 0.04065227 0.01130383 [31] -0.01761393 -0.04628615 -0.07174620 -0.09685232 -0.12107487 -0.14496421 [37] -0.16676257 -0.18767167 -0.20763045 -0.22276888 -0.23898805 -0.25692194 [43] -0.27362169 -0.28935923 -0.30401561 -0.31982837 -0.33620046 -0.34782910 [49] -0.35842354 > (mypacf <- c(rpacf$acf)) [1] 0.9663463671 -0.0052126695 -0.0157349570 0.0001871243 -0.0615009201 [6] -0.0366690099 -0.0478640452 -0.0414238192 0.0054671460 -0.0183418307 [11] 0.0156536980 -0.0076917904 -0.0056367774 -0.0335472575 -0.0093229190 [16] -0.0172151369 -0.0682549581 -0.0140377873 0.0010324695 -0.0219136559 [21] -0.1305908418 -0.0166299388 0.0079647977 0.0233110866 -0.0216823226 [26] -0.0305177737 -0.0083125720 -0.0432256784 0.0070363293 -0.0231347362 [31] -0.0362712093 0.0217308742 -0.0231483752 -0.0103113878 -0.0271576088 [36] -0.0035564951 -0.0029296001 -0.0189250106 0.0411510801 -0.0445070450 [41] -0.0405242100 -0.0082616787 -0.0283402141 -0.0189935924 -0.0493081790 [46] -0.0329958564 0.0510367915 -0.0107055682 > 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/3xcka1228767672.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/4frs61228767672.tab") > > system("convert tmp/182by1228767672.ps tmp/182by1228767672.png") > system("convert tmp/24b7s1228767672.ps tmp/24b7s1228767672.png") > > > proc.time() user system elapsed 0.582 0.312 0.672