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.1,101.1,111.1,93.3,100,108,70.4,75.4,105.5,112.3,102.5,93.5,86.7,95.2,103.8,97,95.5,101,67.5,64,106.7,100.6,101.2,93.1,84.2,85.8,91.8,92.4,80.3,79.7,62.5,57.1,100.8,100.7,86.2,83.2,71.7,77.5,89.8,80.3,78.7,93.8,57.6,60.6,91,85.3,77.4,77.3,68.3,69.9,81.7,75.1,69.9,84,54.3,60,89.9,77,85.3,77.6,69.2,75.5,85.7,72.2,79.9,85.3,52.2,61.2,82.4,85.4,78.2,70.2,70.2,69.3,77.5,66.1,69,79.2,56.2,63.3,77.8,92,78.1,65.1,71.1,70.9,72,81.9,70.6,72.5,65.1,54.9,80) > par5 = '12' > par4 = '1' > par3 = '0' > 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/freestat/rcomp/tmp/1jsn81229163683.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/2i8xt1229163683.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.155093181 0.225963305 0.327694653 -0.041101701 [6] 0.162910553 0.121502205 0.059878664 0.156117439 0.098536216 [11] 0.040619485 -0.022496701 -0.174494259 -0.074689371 -0.073766125 [16] 0.052752149 -0.002725843 0.142953303 0.240702761 -0.012338297 [21] 0.114731940 0.194864580 -0.051283254 0.308103875 0.041255626 [26] 0.036945143 0.176648298 -0.061924475 0.055198704 -0.045630443 [31] -0.188808319 0.005559915 -0.032385135 -0.204662825 -0.083390003 [36] -0.207301484 -0.101069654 -0.074571222 -0.029177076 -0.044208447 [41] -0.022961780 -0.023938839 -0.074233610 -0.118857232 0.002956730 [46] -0.054440506 0.043463177 0.047650399 -0.127746061 > (mypacf <- c(rpacf$acf)) [1] 0.1550931813 0.2068858195 0.2866844078 -0.1693703149 0.0730183751 [6] 0.0539345103 0.0768838140 0.0406614310 0.0430489632 -0.0406507575 [11] -0.1237698901 -0.2322600969 -0.0243392447 0.0305905848 0.2081894660 [16] -0.0334394743 0.1894042586 0.2398713114 -0.0269671374 -0.0400760106 [21] 0.2030269686 -0.0712056867 0.1676864604 -0.2892061297 -0.0547119734 [26] -0.1439660409 -0.0156204147 -0.0710041234 0.0387354218 -0.1499094005 [31] 0.1425079411 0.0224116163 -0.0188284757 -0.1408437111 -0.0519148180 [36] -0.0375221009 0.1142254374 -0.0568198246 -0.0003822911 -0.0657322636 [41] -0.1247531462 -0.0758453383 -0.0995934500 0.0564230184 0.0557102391 [46] -0.0137120491 0.0658425314 -0.0900970273 > 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/3zces1229163683.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/4zhh71229163683.tab") > > system("convert tmp/1jsn81229163683.ps tmp/1jsn81229163683.png") > system("convert tmp/2i8xt1229163683.ps tmp/2i8xt1229163683.png") > > > proc.time() user system elapsed 0.805 0.420 1.169