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(2834,4683,4120,3849,8435,12854,15883,10520,12562,5060,4520,2150,2905,4820,3950,4053,8700,13520,15400,11100,11950,4900,4633,2300,2945,3960,3900,3767,8820,11980,14085,11600,9814,4930,4360,2640,3050,5485,4366,4790,10100,14830,17930,13580,12490,6400,4980,4930,5856,5120,5100,5623,12035,19846,17030,15860,14890,8053,6080,5987,5682,4980,5450,6035,13240,18400,17689,16490,14062,9556,7555,4328) > 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/1z9un1289935318.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/2sib81289935318.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.27454582 0.15150799 -0.17400458 -0.23503773 -0.31673478 [7] -0.25824861 -0.31843102 -0.22817442 -0.15130991 0.08647982 0.32707329 [13] 0.73220627 0.23428773 0.13789310 -0.16277050 -0.15609511 -0.25438676 [19] -0.21368206 -0.25520905 -0.18800535 -0.15942058 0.12062715 0.25992083 [25] 0.52527917 0.21093585 0.07406491 -0.10190173 -0.10802426 -0.21096839 [31] -0.17089429 -0.18479041 -0.17503151 -0.08740599 0.06657039 0.20847549 [37] 0.42724121 0.12957462 0.05615046 -0.06345405 -0.06467941 -0.18245240 [43] -0.10663435 -0.14608432 -0.13638855 -0.03671710 0.01096344 0.20177158 [49] 0.27185649 > (mypacf <- c(rpacf$acf)) [1] 0.2745458155 0.0823389163 -0.2556539435 -0.1626186787 -0.1866867938 [6] -0.1557419834 -0.3024610693 -0.2895210219 -0.3166997238 -0.2277486134 [11] -0.0483375429 0.5421206603 -0.1414004701 -0.1358823872 -0.0648836915 [16] 0.0805928245 0.0122141056 -0.0255918413 0.0517539770 0.0313546847 [21] -0.0751733924 0.1338205209 -0.1116197711 -0.0718478582 0.0681983638 [26] -0.0697448521 0.0381628384 -0.0258301192 -0.0520016357 -0.0294939529 [31] 0.0175781033 -0.0139578467 0.0495208821 -0.1588500130 0.0126355812 [36] 0.1121998964 -0.1119941846 -0.0350242312 -0.0008164319 0.0599894599 [41] -0.0705802823 0.0172907883 0.0661879777 -0.0821193856 0.0644394725 [46] 0.0300660276 -0.0229158080 -0.0882882031 > 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/3v09e1289935318.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/4oarz1289935318.tab") > > try(system("convert tmp/1z9un1289935318.ps tmp/1z9un1289935318.png",intern=TRUE)) character(0) > try(system("convert tmp/2sib81289935318.ps tmp/2sib81289935318.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.556 0.303 0.722