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(11.514,31.514,27.071,29.462,26.105,22.397,23.843,21.705,18.089,20.764,25.316,17704,15548,28029,29383,36438,32034,22679,24319,18004,17537,20366,22782,19169,13807,29743,25591,29096,26482,22405,27044,17970,18730,19684,19785,18479,10698,31956,29506,34506,27165,26736,23691,18157,17328,18205,20995,17382,9367,31124,26551,30651,25859,25100,25778,20418,18688,20424,24776,19814,12738) > par5 = '12' > par4 = '0' > par3 = '1' > 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/1jte11229859325.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/2v57o1229859325.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.0000000000 -0.3030583367 0.1541412101 -0.0946064677 -0.0003943208 [6] 0.0883193840 -0.4054983015 0.1609676116 -0.0906955845 -0.0363730663 [11] 0.0248460840 -0.2357639467 0.5807598905 -0.2607251952 0.1857297657 [16] -0.1141933259 0.0398646540 0.0699136541 -0.2889569622 0.1948637362 [21] -0.1621292290 0.0101338106 -0.0156390732 -0.1447771065 0.3688484489 [26] -0.1671669828 0.1900992112 -0.0856517480 0.0662737084 -0.0441575746 [31] -0.1148867154 0.0605322893 -0.1069736992 -0.0044917939 -0.0063018777 [36] -0.0509125459 0.1507456528 -0.0983811699 0.1715698301 -0.0581679685 [41] 0.0276481862 -0.0419184542 -0.0230957784 0.0475347398 -0.0286581585 [46] -0.0168267146 -0.0213822332 -0.0020946130 -0.0298222309 -0.0492738639 [51] 0.0013558641 0.0016325999 0.0012467071 0.0011682566 0.0011592929 [56] 0.0007366155 0.0005798353 0.0007330460 0.0010172499 0.0005537036 > (mypacf <- c(rpacf$acf)) [1] -0.3030583367 0.0685971122 -0.0335311288 -0.0511236856 0.0954684248 [6] -0.3961061699 -0.0779832084 0.0286897089 -0.1624917296 -0.0146341488 [11] -0.2529782767 0.4121938434 0.0286297390 -0.0183395730 -0.0346796808 [16] -0.0611876917 -0.0118822302 0.0251458318 0.0365115514 -0.0780248232 [21] -0.0847149350 0.0048771307 0.0074674136 0.0452709408 0.0953873992 [26] -0.0093828343 0.0232123933 0.0378419153 -0.1538526313 0.1178455113 [31] -0.1197408006 0.0045317592 0.0057684021 0.0042328857 0.0640007520 [36] -0.0819512755 -0.0504320649 0.0570903293 0.0004592800 -0.0559838547 [41] 0.0230446571 -0.0435380470 0.0761799113 0.0962698417 0.0213689682 [46] -0.0691342676 -0.0060235670 -0.0873780538 -0.0667951315 -0.1330718672 [51] -0.0754542512 -0.0253388682 0.0802332567 -0.0502722073 -0.0648082432 [56] -0.0898517945 -0.0073672577 0.0179682740 -0.0267511949 > 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/3t7sl1229859325.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/4qi9i1229859325.tab") > > system("convert tmp/1jte11229859325.ps tmp/1jte11229859325.png") > system("convert tmp/2v57o1229859325.ps tmp/2v57o1229859325.png") > > > proc.time() user system elapsed 0.600 0.322 0.695