R version 2.7.0 (2008-04-22) 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(118.3,127.3,112.3,114.9,108.2,105.4,122.1,113.5,110,125.3,114.3,115.6,127.1,123,122.2,126.4,112.7,105.8,120.9,116.3,115.7,127.9,108.3,121.1,128.6,123.1,127.7,126.6,118.4,110,129.6,115.8,125.9,128.4,114,125.6,128.5,136.6,133.1,124.6,123.5,117.2,135.5,124.8,127.8,133.1,125.7,128.4,131.9,146.3,140.6,129.5,132.4,125.9,126.9,135.8,129.5,130.2,133.8,123.3,140.6) > 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/rcomp/tmp/13eyj1229356973.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/2iels1229356973.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.300328212 -0.032801133 0.240741295 -0.120290628 [6] 0.183365379 0.020703473 -0.146003154 -0.088697442 0.249178361 [11] -0.231791066 -0.010789761 0.073993402 -0.171798390 0.092414730 [16] 0.043254609 -0.133616753 -0.024810219 0.171337256 -0.229639804 [21] 0.046978819 -0.007544686 -0.131825591 0.248473023 -0.296426197 [26] -0.075082807 0.127591860 -0.116413965 -0.042881232 -0.018588170 [31] -0.015527669 -0.040342376 0.169864497 -0.141314676 0.057581812 [36] 0.109758477 -0.032374395 0.114531696 0.031911491 -0.067943660 [41] -0.012372868 0.148967253 -0.142643533 0.017272748 0.003850307 [46] -0.072189774 0.102915625 -0.067743393 0.017095443 > (mypacf <- c(rpacf$acf)) [1] -0.300328212 -0.135192094 0.211555950 0.019183738 0.202952737 [6] 0.091681601 -0.098987354 -0.301818162 0.141800503 -0.123527070 [11] -0.028754962 0.006280760 0.005316508 -0.063203301 0.088254110 [16] -0.022600189 -0.096885419 0.065789735 -0.113675989 -0.094324094 [21] -0.117520983 -0.003328290 0.187114477 -0.220909601 -0.163893555 [26] -0.013839801 -0.122526324 -0.094816339 -0.015194703 0.067211447 [31] -0.062749015 0.041586896 0.014645505 0.044169162 -0.050405952 [36] 0.077984583 0.048241212 -0.002248098 -0.063181568 -0.103729299 [41] -0.076363803 0.019227617 -0.027683076 -0.096339705 -0.032133250 [46] 0.003846289 0.035789905 0.024851845 > 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/3l1yy1229356973.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/4q9291229356973.tab") > > system("convert tmp/13eyj1229356973.ps tmp/13eyj1229356973.png") > system("convert tmp/2iels1229356973.ps tmp/2iels1229356973.png") > > > proc.time() user system elapsed 1.541 0.545 1.641