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(0.8,1.1,1.3,1.2,1.3,1.1,1.3,1.2,1.6,1.7,1.5,0.9,1.5,1.4,1.6,1.7,1.4,1.8,1.7,1.4,1.2,1,1.7,2.4,2,2.1,2,1.8,2.7,2.3,1.9,2,2.3,2.8,2.4,2.3,2.7,2.7,2.9,3,2.2,2.3,2.8,2.8,2.8,2.2,2.6,2.8,2.5,2.4,2.3,1.9,1.7,2,2.1,1.7,1.8,1.8,1.8,1.3,1.3,1.3,1.2,1.4,2.2,2.9,3.1,3.5,3.6,4.4,4.1,5.1,5.8,5.9,5.4,5.5,4.8,3.2,2.7,2.1,1.9,0.6,0.7,-0.2,-1,-1.7,-0.7) > 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/10v7a1261090118.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/2qutp1261090118.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.9028782985 0.7695438213 0.6360056718 0.4986100928 [6] 0.3503535356 0.1896359385 0.0490055192 -0.0918787189 -0.2177830156 [11] -0.3088986995 -0.3590677702 -0.4111015222 -0.3967481427 -0.3470985125 [16] -0.2904538199 -0.2477236467 -0.2136410587 -0.1480440439 -0.0927139632 [21] -0.0465036171 0.0005584494 0.0371583958 0.0567771665 0.0764483982 [26] 0.0855610742 0.0851721300 0.0783921968 0.0743348373 0.0906855938 [31] 0.0908690921 0.0775701032 0.0709159222 0.0681230281 0.0586768396 [36] 0.0365096205 0.0236866384 0.0121219497 0.0041292407 0.0019527638 [41] 0.0054058193 -0.0088058374 -0.0318540934 -0.0323232721 -0.0361484144 [46] -0.0465512453 -0.0654381064 -0.0752870105 -0.0710285237 -0.0689764865 [51] -0.0701901491 -0.0790029476 -0.0924300032 -0.1036567810 -0.0968601057 [56] -0.0977065410 -0.1026827402 -0.1016853242 -0.0957966878 -0.0842113995 [61] -0.0951149248 > (mypacf <- c(rpacf$acf)) [1] 9.028783e-01 -2.469845e-01 -4.268665e-02 -1.104110e-01 -1.470103e-01 [6] -1.673311e-01 1.646301e-03 -1.804501e-01 -4.425184e-02 2.792952e-02 [11] 5.382674e-02 -2.016780e-01 3.488285e-01 -6.030111e-02 -3.048076e-02 [16] -1.415753e-01 -2.578774e-02 1.882391e-02 -2.321284e-02 -4.462190e-02 [21] 6.253618e-02 -6.774633e-02 7.821909e-02 -2.388161e-02 1.074316e-02 [26] -3.577642e-02 6.201860e-02 -3.454058e-02 6.377694e-02 -2.617552e-02 [31] -1.910193e-02 1.711550e-02 4.632358e-02 -1.025876e-01 -1.635974e-02 [36] 6.237501e-02 -4.096868e-02 6.861639e-02 4.051024e-02 -6.820903e-03 [41] -7.107649e-02 -4.978273e-05 5.363796e-02 -1.148803e-01 1.634111e-03 [46] -6.365014e-03 -6.051648e-02 1.100653e-01 -4.036867e-04 -3.241419e-02 [51] -9.718383e-02 1.982256e-02 -6.550294e-02 -2.366709e-04 -3.743950e-02 [56] 1.346536e-03 -6.693021e-03 -7.797220e-03 -2.874400e-02 -9.812207e-02 > 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/3s1a21261090118.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/4dpue1261090118.tab") > > try(system("convert tmp/10v7a1261090118.ps tmp/10v7a1261090118.png",intern=TRUE)) character(0) > try(system("convert tmp/2qutp1261090118.ps tmp/2qutp1261090118.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.613 0.327 0.721