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(11703.7,16283.6,16726.5,14968.9,14861.0,14583.3,15305.8,17903.9,16379.4,15420.3,17870.5,15912.8,13866.5,17823.2,17872.0,17420.4,16704.4,15991.2,16583.6,19123.5,17838.7,17209.4,18586.5,16258.1,15141.6,19202.1,17746.5,19090.1,18040.3,17515.5,17751.8,21072.4,17170.0,19439.5,19795.4,17574.9,16165.4,19464.6,19932.1,19961.2,17343.4,18924.2,18574.1,21350.6,18594.6,19823.1,20844.4,19640.2,17735.4,19813.6,22160.0,20664.3,17877.4,21211.2,21423.1,21688.7,23243.2,21490.2,22925.8,23184.8,18562.2) > 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/freestat/rcomp/tmp/12bvn1229379676.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/2i2k51229379676.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.576788647 0.452922809 0.543069137 0.504517584 [6] 0.424711649 0.449427054 0.293710133 0.379082434 0.314033628 [11] 0.165543595 0.243935934 0.445199129 0.193111185 0.103015526 [16] 0.134699900 0.164569188 0.113003617 0.120951945 0.037240929 [21] 0.093904863 0.022174861 -0.059220363 0.019711448 0.104536779 [26] -0.027014750 -0.081402490 -0.100924439 -0.037683017 -0.104296900 [31] -0.120140618 -0.135984262 -0.107211671 -0.195284171 -0.213613505 [36] -0.179014864 -0.094822529 -0.176957550 -0.254157604 -0.216203096 [41] -0.157572320 -0.253784059 -0.252458060 -0.243022351 -0.223792486 [46] -0.257499446 -0.274008905 -0.275153528 -0.194855473 -0.221285531 [51] -0.296292579 -0.236849758 -0.187733727 -0.262710273 -0.235123774 [56] -0.205504720 -0.184999150 -0.113485950 -0.118856912 -0.095609085 [61] -0.005332056 > (mypacf <- c(rpacf$acf)) [1] 0.5767886475 0.1801813104 0.3484433820 0.1301977512 0.0442819967 [6] 0.1072636402 -0.2171278034 0.1995371162 -0.1493579102 -0.1282891212 [11] 0.1282948851 0.3508363646 -0.2203076908 -0.1856034191 -0.0813755114 [16] 0.0729576730 -0.0583236125 0.0624224123 0.0466000180 -0.0621909533 [21] -0.0978469197 0.0093722626 0.0930411280 -0.1116207331 0.0249604236 [26] -0.0031171002 -0.0888349734 -0.0064354685 -0.1134393093 0.0269355409 [31] -0.0410300948 0.0258359275 -0.0370940719 -0.0271240656 -0.0362164462 [36] 0.0586767782 -0.0359558301 -0.1024247363 0.0806748995 -0.0386102481 [41] -0.1136961061 -0.0534176016 0.0137287660 -0.0250681438 0.0346913715 [46] 0.0305071301 -0.0595212479 -0.1220895486 0.0766067240 0.0019874925 [51] -0.0389573164 -0.0250696003 0.0171217832 -0.0005099230 -0.0392464958 [56] 0.0721848936 0.1830410859 0.0006431777 0.1070510528 0.0128982860 > 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/3uxva1229379676.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/47c7s1229379676.tab") > > system("convert tmp/12bvn1229379676.ps tmp/12bvn1229379676.png") > system("convert tmp/2i2k51229379676.ps tmp/2i2k51229379676.png") > > > proc.time() user system elapsed 0.832 0.434 0.965