R version 2.9.0 (2009-04-17) Copyright (C) 2009 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(3.25,3.25,3.25,3.25,3.25,3.25,2.85,2.75,2.75,2.55,2.5,2.5,2.1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2.21,2.25,2.25,2.45,2.5,2.5,2.64,2.75,2.93,3,3.17,3.25,3.39,3.5,3.5,3.65,3.75,3.75,3.9,4,4,4,4,4,4,4,4,4,4,4,4,4.18,4.25,4.25,3.97,3.42,2.75,2.31,2,1.66,1.31,1.09,1,1,1) > par7 = '0.95' > par6 = 'White Noise' > 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: > 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 (par6 == 'White Noise') par6 <- 'white' else par6 <- 'ma' > par7 <- as.numeric(par7) > 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/15ldp1261089245.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > racf <- acf(x, par1, main='Autocorrelation', xlab='time lag', ylab='ACF', ci.type=par6, ci=par7, sub=paste('(lambda=',par2,', d=',par3,', D=',par4,', CI=', par7, ', CI type=',par6,')',sep='')) > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/2ty0p1261089245.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.9612345891 0.9002289806 0.8221649744 0.7307541456 [6] 0.6349592479 0.5404867366 0.4504163551 0.3656970573 0.2908538978 [11] 0.2337003142 0.1896688134 0.1518790622 0.1155556991 0.0769678819 [16] 0.0335660347 -0.0107176660 -0.0546806927 -0.0967050995 -0.1370211886 [21] -0.1752951675 -0.2105693872 -0.2425625291 -0.2709597497 -0.2955919663 [26] -0.3158382376 -0.3316533777 -0.3448324235 -0.3563836720 -0.3626190206 [31] -0.3657212304 -0.3666213448 -0.3633687314 -0.3579787438 -0.3498194332 [36] -0.3392466070 -0.3284151138 -0.3127036129 -0.2974653825 -0.2815561326 [41] -0.2652286829 -0.2458504578 -0.2255360790 -0.2093042452 -0.1912932572 [46] -0.1725689120 -0.1584872692 -0.1427938795 -0.1261020276 -0.1080223980 [51] -0.0893063126 -0.0717013776 -0.0531256081 -0.0350344348 -0.0173642258 [56] 0.0002069999 0.0174818116 0.0347566233 0.0508321746 0.0661082191 [61] 0.0813842636 > (mypacf <- c(rpacf$acf)) [1] 0.9612345891 -0.3122919764 -0.1926216296 -0.1412317910 -0.0235371606 [6] 0.0095370575 0.0034591783 -0.0233030653 0.0302195246 0.1288688432 [11] 0.0144528537 -0.0901982044 -0.1203448984 -0.1031844812 -0.0815322666 [16] 0.0071153844 0.0011027701 0.0109861951 -0.0048679881 -0.0195618354 [21] -0.0373793525 -0.0589781695 -0.0681338595 -0.0591606128 -0.0131093574 [26] 0.0123363215 -0.0096075307 -0.0299920815 0.0265553285 -0.0289361493 [31] -0.0481487278 -0.0200018552 -0.0437727266 -0.0058462884 0.0010598174 [36] -0.0356016736 0.0460742936 -0.0444581422 -0.0196501023 -0.0348923942 [41] 0.0277083268 -0.0202469666 -0.0999492744 0.0248949751 0.0059059370 [46] -0.0681406750 0.0301043643 -0.0064946278 0.0091199382 0.0005822079 [51] -0.0474900617 -0.0134016972 -0.0178949327 -0.0009269558 -0.0193125846 [56] 0.0045476488 0.0304211514 -0.0059324719 0.0003872767 0.0064835552 > 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/3bba11261089245.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/40zti1261089245.tab") > > try(system("convert tmp/15ldp1261089245.ps tmp/15ldp1261089245.png",intern=TRUE)) character(0) > try(system("convert tmp/2ty0p1261089245.ps tmp/2ty0p1261089245.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.582 0.327 0.950