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(556,555,554,552,572,571,556,546,547,547,548,550,555,549,555,550,566,573,543,535,542,541,535,536,548,546,548,548,561,563,527,527,541,534,522,527,539,533,532,519,538,542,503,502,522,511,492,500,509,511,505,493,518,518,474,471,483,461,439,446,461,449,441,424,447,448,404,403,411,386,359,370,385,369,368,352,378,383,334,323,330,303,275,284,301,281,284,272,297,300,240,236,247,218,192,201,223,197,195,175,197,204,142,142,151,127,100,114,139,112,123,108,132,140,76,71,81,57,38,46) > 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/1jtf11281950297.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/2jtf11281950297.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.970507515 0.941071307 0.919918863 0.897955625 [6] 0.868973004 0.840662749 0.824635597 0.808245735 0.784396237 [11] 0.759200353 0.738486944 0.721001887 0.688796120 0.656237911 [16] 0.632164399 0.607500572 0.576299190 0.545262924 0.526450545 [21] 0.507066137 0.480571342 0.453914993 0.432692466 0.414396366 [26] 0.383087906 0.351676408 0.328254592 0.304685612 0.275184330 [31] 0.246942248 0.230483347 0.213358884 0.189173875 0.164939482 [36] 0.145150142 0.127322477 0.098784893 0.070359807 0.049521085 [41] 0.029284482 0.003798064 -0.019534595 -0.032629277 -0.046784125 [46] -0.067600301 -0.087306380 -0.102403351 -0.116011721 -0.138289430 [51] -0.161150126 -0.177137712 -0.192350478 -0.212546531 -0.231249227 [56] -0.240558265 -0.250513626 -0.265664132 -0.278458693 -0.286434953 [61] -0.293345082 > (mypacf <- c(rpacf$acf)) [1] 0.9705075151 -0.0139985837 0.1274044068 -0.0254506684 -0.1145454967 [6] -0.0070216637 0.1725499531 -0.0109850826 -0.0851157981 -0.0462876644 [11] 0.0059574680 0.0492401081 -0.2132375880 -0.0129624414 0.0472758810 [16] -0.0370716956 -0.0577112735 -0.0029386060 0.0993255785 -0.0277064643 [21] -0.0431664407 -0.0206043247 0.0073302754 0.0225734448 -0.1370174614 [26] -0.0071123388 0.0098516212 -0.0286699567 -0.0348977228 0.0234521900 [31] 0.0612302091 -0.0301373929 -0.0326604224 -0.0238694748 -0.0193161591 [36] -0.0010118326 -0.0787865897 -0.0107615666 -0.0061854530 -0.0164212056 [41] -0.0233000103 0.0370071197 0.0223664136 -0.0333308866 -0.0248604835 [46] -0.0055763458 -0.0128330201 0.0002936214 -0.0430014457 -0.0354162429 [51] -0.0154698888 -0.0133676185 -0.0193600984 0.0139310371 0.0089944617 [56] -0.0267519936 0.0002349443 0.0160231325 -0.0027111537 0.0056173058 > 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/3x2v91281950297.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/48uuu1281950297.tab") > > try(system("convert tmp/1jtf11281950297.ps tmp/1jtf11281950297.png",intern=TRUE)) character(0) > try(system("convert tmp/2jtf11281950297.ps tmp/2jtf11281950297.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.617 0.319 0.809