R version 2.11.1 (2010-05-31) Copyright (C) 2010 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(12,13,23,24,21,20,18,13,12,25,21,17,10,15,23,12,10,21,9,13,17,14,20,12,13,14,23,14,21,21,21,7,15,28,28,18,22,30,1,26,29,24,26,19,19,41,36,54,49,33,50,43,51,46,45,23,56,41,48,43) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '1' > par1 = '48' > #'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/rcomp/tmp/1rx4f1290158868.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/rcomp/tmp/2rx4f1290158868.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.646879006 0.616868653 0.596984233 0.538279704 [6] 0.558937720 0.569102116 0.451877144 0.396772087 0.280809833 [11] 0.219904014 0.350433001 0.205641108 0.150729570 0.068517202 [16] 0.026571503 0.004350329 0.068816432 -0.043991446 0.018268528 [21] -0.034620725 -0.139610396 -0.084984784 -0.062652820 -0.095551459 [26] -0.135769992 -0.153728888 -0.216395739 -0.189085473 -0.256556457 [31] -0.170885402 -0.177233100 -0.246252244 -0.262580734 -0.259063750 [36] -0.273732807 -0.228125227 -0.203354911 -0.226596903 -0.233317126 [41] -0.265833563 -0.237347663 -0.183699328 -0.172170617 -0.186273628 [46] -0.189046043 -0.206317944 -0.165645123 -0.132698588 > (mypacf <- c(rpacf$acf)) [1] 0.646879006 0.341186553 0.220658109 0.068753114 0.154400056 [6] 0.154571121 -0.127142252 -0.128806196 -0.241458184 -0.164174470 [11] 0.286929332 -0.114157352 -0.094226383 -0.147139277 0.065306801 [16] 0.029250606 0.114354778 -0.154237879 0.156964397 0.148654241 [21] -0.136096221 -0.186081010 0.038167991 0.042277267 -0.108190217 [26] -0.119484534 -0.134162808 -0.028936400 0.022935174 0.049976945 [31] 0.033035258 0.036229768 0.063598830 -0.082647042 -0.065222472 [36] 0.001759569 0.110030801 0.055934684 -0.174863095 -0.090937128 [41] -0.017544137 0.042309953 -0.120259302 -0.034110101 0.069980067 [46] 0.112764263 -0.006406607 -0.077037168 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/rcomp/tmp/3n62o1290158868.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/rcomp/tmp/4gf1r1290158868.tab") > > try(system("convert tmp/1rx4f1290158868.ps tmp/1rx4f1290158868.png",intern=TRUE)) character(0) > try(system("convert tmp/2rx4f1290158868.ps tmp/2rx4f1290158868.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.810 0.500 1.277