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(268,267,266,264,284,283,268,258,259,259,260,262,255,259,258,258,288,289,271,268,274,284,284,279,273,280,276,271,298,297,278,270,280,289,288,293,285,283,275,268,295,290,267,252,268,278,280,278,261,263,259,265,294,285,255,231,246,258,265,260,238,241,239,233,265,255,224,194,210,222,230,225,206,204,207,195,230,221,195,162,182,203,211,206,187,181,189,174,213,201,177,140,165,192,197,196,176,164,177,165,208,195,164,123,147,173,176,170,157,145,148,135,175,168,140,109,129,150,150,152) > 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/html/rcomp/tmp/1r41d1280927172.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/2r41d1280927172.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.00000000 0.06620575 -0.39468752 -0.45132907 -0.04075327 0.20934835 [7] 0.28287396 0.21032023 -0.05348765 -0.42763928 -0.35283514 0.04763443 [13] 0.88367161 0.07267991 -0.37197802 -0.39646647 -0.03764711 0.18484365 [19] 0.24641427 0.18610124 -0.05897916 -0.36043532 -0.29363991 0.03254562 [25] 0.73683242 0.08676014 -0.34979642 -0.33522408 -0.02536603 0.16150586 [31] 0.20797623 0.15498111 -0.06275469 -0.29236547 -0.24345694 0.02836936 [37] 0.60600219 0.10219233 -0.32597349 -0.29106491 -0.01801722 0.15406834 [43] 0.16534805 0.11449128 -0.06692827 -0.21924785 -0.19655687 0.01701890 [49] 0.48483272 > (mypacf <- c(rpacf$acf)) [1] 0.066205746 -0.400827626 -0.464529069 -0.295078272 -0.307289350 [6] -0.157559563 0.162756808 0.301652587 0.026778430 -0.220867041 [11] -0.484723089 0.680223520 -0.148889318 0.095023414 0.257223531 [16] -0.012728596 0.060850922 -0.036675882 -0.151243847 -0.083471954 [21] 0.074561781 -0.001886886 0.075252873 -0.082626039 0.113132888 [26] -0.074761962 -0.032264194 0.014118790 -0.088464690 0.017715373 [31] -0.018604528 -0.025297951 0.039466344 -0.030404532 0.031792301 [36] 0.015125000 0.007837424 0.033953267 -0.055274121 -0.047655986 [41] 0.050600202 -0.145930654 -0.079864735 -0.038679272 -0.017878555 [46] 0.025203205 -0.024601280 -0.005429729 > 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/3nezl1280927172.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/4y5g61280927172.tab") > > try(system("convert tmp/1r41d1280927172.ps tmp/1r41d1280927172.png",intern=TRUE)) character(0) > try(system("convert tmp/2r41d1280927172.ps tmp/2r41d1280927172.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.561 0.310 0.790