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(33,32,31,29,49,48,33,23,24,24,25,27,24,21,15,21,49,48,35,36,51,50,61,63,61,62,58,65,93,94,86,88,102,107,121,127,125,128,117,127,160,162,153,160,177,178,196,212,212,211,204,216,248,250,240,249,275,277,286,302,290,290,277,285,311,300,291,299,332,337,343,360,353,351,341,348,381,358,353,358,399,409,407,419,418,421,414,424,463,437,430,436,474,489,482,492,502,500,493,504,538,516,502,501,541,571,559,569,576,573,562,570,597,573,562,556,600,630,624,634) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '1' > 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/1o6va1278525059.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/2o6va1278525059.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.020244452 -0.439239267 -0.171113098 0.205141653 [6] 0.179139793 -0.233724602 0.084690545 0.169240041 -0.148327400 [11] -0.393618176 -0.010803994 0.834950828 0.016632433 -0.424257191 [16] -0.161590478 0.179083158 0.202329128 -0.206352597 0.009584038 [21] 0.136881744 -0.130739824 -0.309518047 -0.035267901 0.663836835 [26] 0.027655976 -0.377161538 -0.138183251 0.157589547 0.206078435 [31] -0.176767824 -0.024506220 0.083010325 -0.131335208 -0.222973125 [36] -0.007563965 0.513378529 0.019717998 -0.339463498 -0.101975289 [41] 0.159280220 0.183404331 -0.140503007 -0.059599174 0.038408019 [46] -0.118813371 -0.143534172 0.028826066 0.380224057 -0.009757093 [51] -0.295507723 -0.065729862 0.182289129 0.166371751 -0.100603043 [56] -0.058858614 0.029023345 -0.098354093 -0.094666463 0.061741331 [61] 0.273526518 > (mypacf <- c(rpacf$acf)) [1] 0.020244452 -0.439829363 -0.185316516 0.011709565 0.044453593 [6] -0.207707373 0.265645518 0.054684327 -0.144713329 -0.346877866 [11] -0.106264423 0.732720631 -0.100723732 0.123712483 0.057412833 [16] -0.166795068 -0.093230740 0.036961946 -0.107451955 -0.010115829 [21] -0.011665451 0.102843003 -0.070088069 -0.066551721 0.052009900 [26] -0.010086543 -0.014473794 0.067806483 -0.032335750 -0.038160619 [31] 0.052292021 -0.153541875 -0.082544603 0.030502164 0.102125767 [36] -0.050297703 0.061808901 -0.025421229 -0.033155267 0.003167406 [41] -0.022884769 0.006851997 -0.096401398 -0.006145508 0.024288213 [46] -0.028663948 0.049163610 0.002799306 -0.084479640 0.048349450 [51] -0.057982539 0.068199647 0.039950059 0.075112448 0.071703517 [56] 0.072756102 -0.025494158 -0.005166904 -0.025259165 -0.057651220 > 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/396bx1278525059.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/4d6al1278525059.tab") > > try(system("convert tmp/1o6va1278525059.ps tmp/1o6va1278525059.png",intern=TRUE)) character(0) > try(system("convert tmp/2o6va1278525059.ps tmp/2o6va1278525059.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.623 0.329 1.828