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(72.5,72.0,98.8,75.2,81.2,88.0,54.6,68.6,101.5,93.4,84.5,91.4,64.5,64.5,117.3,73.5,79.7,102.6,57.9,73.1,102.4,82.3,89.1,84.7,81.4,67.5,113.9,83.8,73.9,103.9,67.9,62.5,125.4,79.1,106.3,96.2,94.3,85.6,117.4,88.5,124.2,119.3,76.8,70.6,122.1,109.5,119.9,102.3,79.6,78.2,103.6,77.8,99.1,105.7,84.1,88.7,108.0,98.1,101.0,82.0) > 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/1elco1229879774.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/26d891229879774.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.011986090 -0.076534309 0.295556179 -0.096903620 [6] 0.035352971 0.647909326 -0.044740763 -0.047592060 0.208837445 [11] -0.108992474 -0.100475424 0.621023030 -0.094757645 -0.143173836 [16] 0.199930366 -0.175233024 -0.089457593 0.400752700 -0.126376858 [21] -0.064227315 0.092540927 -0.214170344 -0.122278554 0.316329318 [26] -0.140876207 -0.125509284 0.044050098 -0.241228168 -0.133009053 [31] 0.179890740 -0.095498092 -0.093889543 -0.049842020 -0.253172432 [36] -0.133644127 0.144001300 -0.101801890 -0.109495832 -0.046278832 [41] -0.207833799 -0.087974983 0.068763021 -0.052658358 -0.052122153 [46] -0.043790364 -0.089092388 -0.025889252 0.050230070 -0.031636213 [51] -0.044739278 -0.020676350 -0.047281092 -0.014719833 0.003765086 [56] -0.017531945 -0.013235605 -0.022019057 -0.003353236 0.006766717 > (mypacf <- c(rpacf$acf)) [1] -0.0119860895 -0.0766889928 0.2954289508 -0.1122348079 0.0946827620 [6] 0.6057550530 -0.0043017147 -0.0068405269 -0.0749024974 -0.0276631390 [11] -0.2723099202 0.3946181855 -0.1497876202 -0.0794602289 -0.0395830829 [16] -0.0209070998 -0.0201536380 -0.1984439783 0.1317200537 0.0287818014 [21] -0.0557020989 -0.1366035902 0.1094685246 -0.0925583806 -0.0683058046 [26] 0.0275109226 -0.1036814867 -0.0447745624 -0.0752560098 0.0127433963 [31] 0.1297405737 -0.1201637081 -0.0582875949 -0.0231655610 -0.0160563856 [36] -0.0475647740 0.0047948503 0.0214410604 -0.0490059712 0.0688107640 [41] 0.0032836414 0.0252048169 -0.0927646857 0.0274687399 0.1268888252 [46] 0.1146783678 0.0439282818 -0.0814772284 -0.0145407099 -0.0875072065 [51] -0.0639277280 -0.0094625679 -0.0137726822 -0.0490975009 -0.0919020280 [56] 0.0555845743 0.0083213431 -0.0576549398 0.0001575013 > 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/3m1ik1229879774.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/4o2e81229879774.tab") > > system("convert tmp/1elco1229879774.ps tmp/1elco1229879774.png") > system("convert tmp/26d891229879774.ps tmp/26d891229879774.png") > > > proc.time() user system elapsed 0.606 0.317 0.707