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(75,74,73,71,91,90,75,65,66,66,67,69,75,79,75,77,100,100,94,83,83,83,84,88,89,98,94,84,111,98,98,83,79,78,80,94,98,104,94,90,115,104,114,99,96,98,104,111,117,125,117,118,151,145,155,133,124,125,131,133,136,141,130,137,177,183,191,166,156,153,164,164,168,173,164,165,205,207,215,190,169,175,188,188,196,201,194,197,237,236,244,222,195,199,207,204,212,222,214,217,258,256,251,223,198,206,214,212,227,238,228,235,275,278,278,251,225,232,238,239) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '1' > 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/1unm61282228744.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/2unm61282228744.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.074634070 -0.150113960 -0.257257284 -0.235980581 [6] 0.030096120 0.151462934 -0.001474878 -0.207796964 -0.220840455 [11] -0.139955773 0.055797291 0.850487733 0.044744743 -0.113416754 [16] -0.251048432 -0.222713977 0.048052483 0.158394424 -0.004566345 [21] -0.164531974 -0.187609410 -0.107457220 0.055168933 0.713471382 [26] 0.018772516 -0.100518100 -0.225886531 -0.189671645 0.061675290 [31] 0.146276991 -0.009429734 -0.119065723 -0.175980584 -0.109187156 [36] 0.039274608 0.579752945 0.032826556 -0.088014302 -0.197012536 [41] -0.158610031 0.077838888 0.113819589 -0.039626382 -0.083949454 [46] -0.149279808 -0.091561229 0.015159564 0.467084609 > (mypacf <- c(rpacf$acf)) [1] 0.074634070 -0.156556261 -0.239795579 -0.247112958 -0.036936607 [6] 0.018070161 -0.136867535 -0.286497304 -0.285745050 -0.351498096 [11] -0.414477604 0.718662191 -0.225378090 0.082069682 -0.030646767 [16] 0.046406616 -0.091324973 0.034007095 0.001624454 0.037123181 [21] -0.016838330 0.104245943 0.025871269 -0.006468043 0.031149966 [26] -0.037610784 0.094440625 0.040101120 0.052325686 -0.011966237 [31] 0.073837622 0.064017211 -0.032360102 -0.067183673 0.003997963 [36] -0.102557729 0.115528036 -0.091418924 0.066896076 -0.049913559 [41] 0.061336038 -0.164728539 -0.071864097 -0.063266043 -0.003193320 [46] -0.091113411 -0.075262809 -0.016398076 > 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/3fnkc1282228744.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/4i6ji1282228744.tab") > > try(system("convert tmp/1unm61282228744.ps tmp/1unm61282228744.png",intern=TRUE)) character(0) > try(system("convert tmp/2unm61282228744.ps tmp/2unm61282228744.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.810 0.690 1.544