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(239,238,237,235,233,232,233,235,236,236,237,239,238,237,244,230,237,244,239,240,230,228,231,228,225,227,238,214,222,233,228,218,203,209,207,203,195,199,207,182,181,189,186,174,153,158,153,147,143,156,168,142,146,150,145,133,111,115,109,105,96,112,127,107,116,125,120,107,86,87,79,83,75,89,104,86,98,98,85,74,49,54,47,56) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '0' > 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/1boyr1281079442.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/2boyr1281079442.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.958940568 0.917371136 0.882681196 0.843929107 [6] 0.810463695 0.778072943 0.764106109 0.746272620 0.719876021 [11] 0.696428343 0.671727925 0.643330557 0.596115860 0.550346311 [16] 0.509794234 0.470714193 0.432942433 0.395613672 0.372429148 [21] 0.342232895 0.308273352 0.278567924 0.246881122 0.211390917 [26] 0.163779285 0.120007860 0.077636621 0.038523741 0.002091778 [31] -0.034777234 -0.061078180 -0.089529765 -0.117057665 -0.139899470 [36] -0.163259650 -0.189837415 -0.223819659 -0.253629335 -0.282988298 [41] -0.308795332 -0.328836765 -0.348114300 -0.362130943 -0.378725798 [46] -0.389657316 -0.395405522 -0.400891675 -0.405922046 > (mypacf <- c(rpacf$acf)) [1] 0.9589405681 -0.0273007025 0.0639517973 -0.0705320585 0.0534230717 [6] -0.0155920235 0.2279650903 -0.0761137274 -0.0705627195 -0.0119225919 [11] -0.0024356526 -0.0563213819 -0.2279341089 -0.0287446080 -0.0327858222 [16] 0.0379265946 -0.0482278882 -0.0412514212 0.0768237227 -0.0818973820 [21] 0.0068983713 -0.0053041735 -0.0165836876 -0.0758960150 -0.0989881029 [26] -0.0267080173 -0.0768547062 0.0451248112 -0.0531003250 -0.0511069065 [31] 0.0141369377 0.0022403349 0.0250171005 0.0183974275 0.0011340086 [36] -0.0690574226 -0.0251216461 -0.0144422385 -0.0469659160 0.0221905512 [41] -0.0008216164 -0.0330645765 -0.0276442559 -0.0206219995 0.0458918639 [46] 0.0472503975 0.0282868268 -0.0159439632 > 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/3eoee1281079442.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/47yez1281079442.tab") > > try(system("convert tmp/1boyr1281079442.ps tmp/1boyr1281079442.png",intern=TRUE)) character(0) > try(system("convert tmp/2boyr1281079442.ps tmp/2boyr1281079442.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.567 0.336 4.579