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(182,213,227,209,219,221,114,97,205,215,224,189,182,201,198,173,238,258,122,101,259,243,188,173,224,215,196,159,187,208,131,93,210,228,176,195,188,188,190,188,176,225,93,79,235,247,195,197,211,156,209,180,185,303,129,85,249,231,212,240,234,217,287,221,208,241,156,96,320,242,227,200) > 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/html/rcomp/tmp/1dq471292321489.ps",horizontal=F,onefile=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/2dq471292321489.ps",horizontal=F,onefile=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.104112074 -0.371470211 0.070606603 0.063144419 [6] -0.051179271 0.082462950 -0.016465867 0.099752705 0.091565633 [11] -0.332999500 0.037382474 0.643888199 -0.001794792 -0.384532082 [16] 0.062666532 0.051865881 -0.068818197 -0.025533210 -0.085031795 [21] 0.019947683 -0.003805077 -0.268637588 0.036376931 0.461559631 [26] 0.015878836 -0.337062951 -0.045490802 0.010516763 -0.066293763 [31] -0.045518948 -0.033618151 -0.013494928 -0.010192601 -0.200710579 [36] 0.004070137 0.356837656 0.034191826 -0.238430938 -0.056330034 [41] 0.023609259 -0.074084577 0.010790099 0.033675845 0.016518883 [46] 0.003526087 -0.111876900 -0.024813685 0.248661429 > (mypacf <- c(rpacf$acf)) [1] 0.104112074 -0.386498922 0.195469824 -0.156672379 0.086892151 [6] 0.042152782 -0.057152609 0.243671374 -0.070291116 -0.264598108 [11] 0.272685965 0.451553771 -0.148434633 -0.092319989 0.021810883 [16] -0.049649928 -0.006882316 -0.183317002 -0.072881124 -0.143636378 [21] -0.141824684 0.059252833 -0.026445540 0.063432483 0.143051064 [26] -0.030580732 -0.072260513 -0.053693104 -0.001597578 -0.028282775 [31] 0.005163047 -0.157126473 0.075787952 -0.106407264 -0.002215416 [36] 0.088338203 -0.090454195 0.145674367 -0.079541214 0.005588617 [41] -0.065313007 0.090168834 0.065620407 0.028209852 -0.020522644 [46] 0.003726677 -0.065829557 -0.106871374 > 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/3js4b1292321490.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/4nb3z1292321490.tab") > > try(system("convert tmp/1dq471292321489.ps tmp/1dq471292321489.png",intern=TRUE)) character(0) > try(system("convert tmp/2dq471292321489.ps tmp/2dq471292321489.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.587 0.318 1.389