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(103.3,107.9,101,94.6,94.2,92.3,107.1,102.6,103.1,104.1,92.7,87,109.3,113.9,103.3,100.8,97.4,98.9,110.8,103.5,99.8,104.9,95.2,85.7,110,113.7,101.1,103.6,96.2,98.3,119.7,109.4,103.5,118.2,98.7,96.8,121.8,124,119.6,122.5,109.7,111.6,131.2,124.4,116.9,131.8,107.4,111,134,126.2,131.2,130.1,123.1,126.3,148.6,130.1,142.3,154.4,121.6,124.8,143.6,146.9,144.6,137.1,134.7,130.8,153.5,137.6,146.5,156.7,137.6,131.4,147.4,158.5,151.5,142.5,131.3,133.4,136.9,143.2,136.4,145.9,138.8,122.9) > par5 = '12' > par4 = '1' > par3 = '1' > par2 = '1' > par1 = '36' > #'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/15ouw1230131635.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/2r4w91230131635.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.575819194 0.055488155 0.183068171 -0.155113528 [6] 0.058422682 0.075886115 -0.092139023 -0.129376105 0.314036305 [11] -0.220474488 -0.005177576 0.057062799 -0.059012260 0.108635287 [16] -0.049446817 -0.043711686 0.004324968 0.183201932 -0.199339290 [21] 0.056796541 0.099735995 -0.264755574 0.380338838 -0.299386151 [26] 0.016463491 0.158619705 -0.087495711 -0.084243272 0.150392493 [31] -0.124019533 0.014899587 0.145469178 -0.222325755 0.085347535 [36] 0.075798682 -0.110062485 > (mypacf <- c(rpacf$acf)) [1] -0.575819194 -0.413025533 -0.017337662 0.015999882 0.031649490 [6] 0.131715959 0.086133219 -0.281865531 0.043702990 0.086563645 [11] -0.017038711 -0.156050466 -0.093739104 0.133264091 0.106461621 [16] -0.003452226 -0.038665693 0.199912263 0.042055006 -0.089415870 [21] 0.109963759 -0.187668632 0.089327243 -0.075060499 -0.058363750 [26] 0.083327272 0.038525382 -0.122427654 0.050508189 -0.034184417 [31] 0.034957450 -0.053082977 -0.090290195 -0.044616946 -0.011880569 [36] -0.095576895 > 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/37vah1230131635.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/48lsd1230131635.tab") > > system("convert tmp/15ouw1230131635.ps tmp/15ouw1230131635.png") > system("convert tmp/2r4w91230131635.ps tmp/2r4w91230131635.png") > > > proc.time() user system elapsed 0.556 0.318 0.660