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(110.40,96.40,101.90,106.20,81.00,94.70,101.00,109.40,102.30,90.70,96.20,96.10,106.00,103.10,102.00,104.70,86.00,92.10,106.90,112.60,101.70,92.00,97.40,97.00,105.40,102.70,98.10,104.50,87.40,89.90,109.80,111.70,98.60,96.90,95.10,97.00,112.70,102.90,97.40,111.40,87.40,96.80,114.10,110.30,103.90,101.60,94.60,95.90,104.70,102.80,98.10,113.90,80.90,95.70,113.20,105.90,108.80,102.30,99.00,100.70,115.50) > 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/148hc1228827795.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/271qe1228827795.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.036298437 0.097753245 0.266236920 -0.172634599 [6] 0.109549016 0.044690254 -0.297519954 -0.152661545 0.023244105 [11] -0.282113163 -0.140453458 -0.154457902 -0.313796609 0.088319138 [16] 0.057118083 -0.156350321 0.178620434 0.040481998 -0.046870405 [21] 0.208248506 0.087910832 -0.007890430 0.301252569 -0.023656285 [26] -0.029675111 0.157223315 -0.055719929 0.057276443 -0.033046659 [31] -0.127667685 0.031292216 -0.052630008 -0.070319833 -0.137685187 [36] -0.042320310 -0.037383685 0.004631856 0.070718254 -0.109488266 [41] 0.098634736 0.031035302 0.034299226 0.032187997 0.004560347 [46] -0.010396041 -0.008533991 0.049504001 -0.075218978 > (mypacf <- c(rpacf$acf)) [1] -0.036298437 0.096562897 0.275880178 -0.171891746 0.047703646 [6] 0.015373988 -0.252777189 -0.279310531 0.105556927 -0.123598247 [11] -0.218733230 -0.201145205 -0.177118000 0.008664007 0.069468094 [16] -0.130398667 0.011614565 -0.039604199 -0.201565914 -0.162242858 [21] 0.095059491 -0.009701277 0.058265630 -0.144619686 -0.096050271 [26] -0.045749297 0.100539528 0.137442856 -0.110789139 -0.093477933 [31] 0.076843084 -0.112776097 0.053904045 -0.017866995 0.071173582 [36] 0.003909444 -0.065371775 0.051090107 0.097834148 0.126382633 [41] -0.031856589 -0.014198306 -0.044439813 0.019278192 -0.065314854 [46] -0.062175919 0.098712076 -0.032829081 > 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/38e0b1228827795.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/46loe1228827795.tab") > > system("convert tmp/148hc1228827795.ps tmp/148hc1228827795.png") > system("convert tmp/271qe1228827795.ps tmp/271qe1228827795.png") > > > proc.time() user system elapsed 0.822 0.420 0.932