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(98.6,98,106.8,96.6,100.1,107.7,91.5,97.8,107.4,117.5,105.6,97.4,99.5,98,104.3,100.6,101.1,103.9,96.9,95.5,108.4,117,103.8,100.8,110.6,104,112.6,107.3,98.9,109.8,104.9,102.2,123.9,124.9,112.7,121.9,100.6,104.3,120.4,107.5,102.9,125.6,107.5,108.8,128.4,121.1,119.5,128.7,108.7,105.5,119.8,111.3,110.6,120.1,97.5,107.7,127.3,117.2,119.8,116.2,111,112.4,130.6,109.1,118.8,123.9,101.6,112.8,128,129.6,125.8,119.5,115.7,113.6,129.7,112,116.8,127,112.1,114.2,121.1,131.6,125,120.4) > par5 = '12' > par4 = '1' > 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/freestat/rcomp/tmp/1uqkz1229000117.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/2tgbi1229000117.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.145046923 0.058712256 0.258792238 -0.037472450 [6] 0.062081425 0.203018007 -0.129214952 0.122839964 0.205254725 [11] -0.212204572 -0.078274967 -0.205541393 -0.253606323 0.088509430 [16] -0.128006328 -0.151608284 0.211294803 -0.163350735 -0.193643801 [21] 0.002249667 -0.067859972 -0.098198743 0.136264079 -0.232277395 [26] -0.139454240 0.048191125 -0.061616257 -0.062748961 -0.002071167 [31] -0.053355712 0.051533379 0.027836968 -0.155536061 0.039952163 [36] 0.057762368 0.029168486 0.230201150 0.104211398 -0.051874130 [41] 0.137919337 -0.055817396 -0.040228420 0.106234321 0.039468205 [46] -0.030631278 0.073441229 -0.067293747 -0.108898120 -0.053336160 [51] -0.133493637 -0.017269879 -0.013842310 -0.036175718 0.026073289 [56] -0.029852781 -0.072377335 -0.010648341 -0.009209417 0.007321068 [61] 0.039980093 > (mypacf <- c(rpacf$acf)) [1] 1.450469e-01 3.848328e-02 2.506590e-01 -1.174910e-01 7.577586e-02 [6] 1.334215e-01 -1.612436e-01 1.488267e-01 1.092522e-01 -2.208756e-01 [11] -1.200415e-01 -2.810231e-01 -5.068146e-02 1.288083e-01 -9.964458e-02 [16] 4.329633e-02 1.943340e-01 -1.543599e-01 -8.451766e-02 -4.618486e-02 [21] 2.115968e-01 -2.005951e-01 -2.376291e-02 -2.419258e-01 -2.036441e-01 [26] -1.124482e-02 2.109883e-01 1.805683e-02 4.963625e-02 -8.080172e-02 [31] -6.099645e-02 -1.184673e-02 1.845730e-03 2.568161e-02 -2.288575e-03 [36] -5.891732e-02 7.080739e-02 -1.392678e-02 4.877499e-02 -2.248606e-02 [41] -2.873838e-02 3.478567e-02 -1.064127e-01 -9.756250e-02 -7.309213e-03 [46] -7.798989e-02 6.848415e-02 -1.465571e-01 -1.578379e-03 5.340377e-05 [51] 3.952319e-02 -1.501073e-02 5.140553e-03 -4.168119e-02 2.559133e-03 [56] -1.159098e-02 -4.356786e-02 -5.136254e-02 3.527837e-03 -5.309125e-02 > 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/3gnml1229000117.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/4zzre1229000117.tab") > > system("convert tmp/1uqkz1229000117.ps tmp/1uqkz1229000117.png") > system("convert tmp/2tgbi1229000117.ps tmp/2tgbi1229000117.png") > > > proc.time() user system elapsed 0.837 0.423 0.947