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(100.29,101.12,102.65,102.71,103.39,102.8,102.07,102.15,101.21,101.27,101.86,101.65,101.94,102.62,102.71,103.39,104.51,104.09,104.29,104.57,105.39,105.15,106.13,105.46,106.47,106.62,106.52,108.04,107.15,107.32,107.76,107.26,107.89,109.08,110.4,111.03,112.05,112.28,112.8,114.17,114.92,114.65,115.49,114.67,114.71,115.15,115.03) > par5 = '12' > par4 = '0' > par3 = '1' > 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/140r01230067526.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/287l31230067527.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.088162533 0.157031602 0.228325645 -0.297630953 [6] -0.001002846 0.034596140 -0.170104057 -0.127708084 -0.003143629 [11] -0.187776384 -0.047314237 0.130680069 -0.073943499 0.059453792 [16] 0.109249182 -0.210746941 0.052729651 0.168370507 -0.229048640 [21] 0.309417850 -0.135596989 -0.017440415 0.182010587 -0.055953529 [26] 0.005992256 -0.027079327 -0.178709850 -0.198043256 -0.060810997 [31] -0.084920115 -0.083853948 0.099233185 -0.021849431 -0.032968109 [36] 0.124592836 0.027732395 0.091596326 0.165288163 -0.040888737 [41] 0.044571898 -0.030356176 -0.056369970 0.005913467 -0.023963782 [46] -0.011399115 > (mypacf <- c(rpacf$acf)) [1] -0.0881625331 0.1504281925 0.2612457608 -0.3045845216 -0.1517033487 [6] 0.1081761797 0.0132815442 -0.2938804936 -0.0768530259 0.0030546280 [11] -0.0298626737 0.0431034746 -0.0041572352 -0.0413418121 0.0139692377 [16] -0.1961150218 -0.0612234504 0.2648356424 -0.1427704507 0.0871894008 [21] -0.1707150836 0.1744235981 0.1163550814 -0.0127175128 -0.1764309165 [26] -0.1090703314 -0.1420933861 -0.0839770325 -0.1001551299 0.0457085103 [31] -0.0340676652 -0.1049137522 -0.0074864697 0.0003478604 -0.0740152575 [36] -0.0305280886 0.0398107770 -0.0410437190 0.1066701699 -0.0932852295 [41] 0.0281688849 -0.0854168173 -0.0304298147 -0.0435538774 0.0701688710 > 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/318gz1230067527.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/41c171230067527.tab") > > system("convert tmp/140r01230067526.ps tmp/140r01230067526.png") > system("convert tmp/287l31230067527.ps tmp/287l31230067527.png") > > > proc.time() user system elapsed 1.512 0.546 1.616