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(5014,6153,6441,5584,6427,6062,5589,6216,5809,4989,6706,7174,6122,8075,6292,6337,8576,6077,5931,6288,7167,6054,6468,6401,6927,7914,7728,8699,8522,6481,7502,7778,7424,6941,8574,9169,7701,9035,7158,8195,8124,7073,7017,7390,7776,6197,6889,7087,6485,7654,6501,6313,7826,6589,6729,5684,8105,6391,5901,6758) > 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/1haj61228769307.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/2yotk1228769307.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.337026485 0.325202677 0.494195498 0.269518357 [6] 0.247339670 0.205013174 0.185394001 0.145136077 0.302034858 [11] 0.097636995 0.014188665 0.248919413 -0.046166770 0.041745112 [16] 0.061489922 -0.152912380 -0.036610452 -0.144352704 -0.113254987 [21] -0.231566775 -0.067144615 -0.155886847 -0.218497949 -0.079248724 [26] -0.260628577 -0.208429165 -0.246483593 -0.241588891 -0.169541805 [31] -0.226058169 -0.239849261 -0.216920391 -0.110512949 -0.222107847 [36] -0.227078445 0.007159417 -0.128543044 -0.072311744 -0.053809532 [41] -0.008856527 -0.007497706 -0.031104159 0.010613144 -0.034632305 [46] 0.052416735 0.034802006 -0.006801451 0.041526491 0.034531827 [51] 0.051308172 0.040008347 0.031332408 0.022990230 0.039466949 [56] 0.057782490 -0.018904490 0.034597957 0.037832165 0.006093013 > (mypacf <- c(rpacf$acf)) [1] 0.337026485 0.238732724 0.395145895 0.016306075 0.007717300 [6] -0.099350530 0.023334210 -0.010082196 0.287736461 -0.114357952 [11] -0.165376535 0.075035532 -0.178378225 0.104721155 -0.021548733 [16] -0.190241235 -0.039980048 -0.206693509 0.117349362 -0.115561763 [21] 0.145066722 -0.063608400 -0.057301891 -0.078522789 -0.021259983 [26] -0.094589428 -0.070916679 0.055133023 0.040499911 0.026321537 [31] -0.218222651 0.030330275 0.012856945 -0.012134839 0.034227197 [36] 0.110641346 0.027654816 -0.094991192 0.003073657 0.102524907 [41] 0.023360125 -0.051312697 -0.046086721 -0.092810984 -0.082814029 [46] 0.133202908 -0.047640459 -0.025088065 -0.074489578 -0.055031628 [51] -0.028729647 -0.019624589 -0.012300452 0.011851563 -0.037225539 [56] 0.047705044 -0.061427583 -0.057665141 0.005353802 > 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/3fnu01228769307.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/4yypg1228769307.tab") > > system("convert tmp/1haj61228769307.ps tmp/1haj61228769307.png") > system("convert tmp/2yotk1228769307.ps tmp/2yotk1228769307.png") > > > proc.time() user system elapsed 0.594 0.318 0.687