R version 2.10.1 (2009-12-14) 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(59,58,57,55,53,52,53,55,56,56,57,59,68,68,68,70,66,64,72,80,84,82,83,86,99,100,95,98,103,107,114,123,132,137,141,146,156,156,143,143,151,149,156,166,177,180,189,195,205,209,199,191,198,200,208,224,234,243,249,258,274,270,261,258,261,258,264,270,267,287,297,306,322,323,309,303,306,301,316,327,330,342,359,379) > 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/11lah1278074431.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/21lah1278074431.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.354753059 -0.002624199 0.076096269 -0.109679196 [6] -0.224462147 -0.164161278 -0.237331140 -0.266117913 -0.016507680 [11] 0.009429568 0.237270365 0.590244856 0.298452302 0.026572503 [16] -0.011840169 -0.025019405 -0.118889158 -0.178957101 -0.283585389 [21] -0.198772123 -0.122253836 -0.056349875 0.242204032 0.396793054 [26] 0.195980876 0.042123501 0.050951043 -0.010649112 -0.038017838 [31] -0.054982539 -0.227403720 -0.192038858 -0.081929065 -0.015099768 [36] 0.126994211 0.272182658 0.128119426 -0.024809608 0.025736175 [41] -0.007331780 -0.060450688 -0.029252844 -0.133490568 -0.183515008 [46] -0.059657362 0.006850470 0.077236904 0.130162123 > (mypacf <- c(rpacf$acf)) [1] 0.354753059 -0.146970076 0.151183078 -0.235141718 -0.088439967 [6] -0.098186764 -0.185755915 -0.145026915 0.084145210 -0.103304431 [11] 0.344252462 0.406009499 -0.030653938 -0.033499131 -0.208263340 [16] 0.081570456 0.027637883 -0.033665711 -0.080809501 0.137352336 [21] -0.208589133 0.048581215 0.049989954 0.057864452 -0.042637289 [26] -0.047906284 0.049563379 -0.022707974 0.013456440 0.140946326 [31] 0.026392062 -0.045644935 0.057291981 -0.011079334 -0.023564971 [36] -0.013940771 -0.030890167 -0.008423841 -0.051056412 -0.101608540 [41] -0.008537836 0.072121965 -0.033624941 0.022164473 0.018664241 [46] -0.077587075 -0.002578505 -0.100415852 > 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/3xdq81278074431.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/4qm7b1278074431.tab") > > try(system("convert tmp/11lah1278074431.ps tmp/11lah1278074431.png",intern=TRUE)) character(0) > try(system("convert tmp/21lah1278074431.ps tmp/21lah1278074431.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.540 0.360 0.618