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(0.65,0.65,0.65,0.65,0.65,0.65,0.66,0.66,0.66,0.65,0.65,0.65,0.65,0.65,0.65,0.65,0.66,0.67,0.66,0.67,0.66,0.66,0.66,0.66,0.71,0.74,0.75,0.75,0.75,0.75,0.7,0.69,0.69,0.68,0.68,0.68,0.67,0.66,0.66,0.67,0.67,0.67,0.67,0.68,0.68,0.67,0.67,0.67,0.67,0.67,0.69,0.69,0.69,0.69,0.69,0.69,0.7,0.69,0.68,0.7,0.7,0.71,0.69,0.7,0.7,0.71,0.71,0.71,0.71,0.7,0.7,0.71,0.71,0.71,0.71,0.7,0.69,0.7,0.7,0.7,0.71,0.7,0.7,0.69) > 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/1td6d1290272102.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/2td6d1290272102.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.0000000000 0.1478521522 0.0476357385 -0.0129862763 -0.0926812028 [6] -0.1428010448 -0.2525539144 0.0384657898 -0.0021175964 -0.0031065837 [11] 0.0068894603 -0.0432303817 -0.0532729663 -0.1029099498 -0.0728752771 [16] 0.0468503662 -0.0428638746 -0.0023270290 0.0673020425 -0.0018907111 [21] -0.1526865550 0.0681979487 -0.0129455533 -0.0525632225 0.0099436859 [26] 0.0423926512 0.0323500666 0.0819405095 0.0222842117 -0.0979708307 [31] -0.0302731932 -0.0107406933 0.0693905511 -0.1014439215 0.0097109830 [36] 0.0397456557 0.0192008982 0.0287140838 -0.0614830156 0.1088220579 [41] 0.0386635872 -0.0710892823 0.0390999052 -0.0305757070 0.0194975944 [46] -0.0005643045 0.0795669399 -0.0111130180 0.0284581106 > (mypacf <- c(rpacf$acf)) [1] 0.147852152 0.026351531 -0.024287281 -0.090731695 -0.118940241 [6] -0.219718281 0.112566898 -0.015467972 -0.031869419 -0.042394197 [11] -0.090669208 -0.085672478 -0.056686997 -0.074932039 0.050722166 [16] -0.096105221 -0.059197921 0.022859238 -0.066878290 -0.207084572 [21] 0.137344494 -0.105892902 -0.085921027 0.005433387 -0.045590879 [26] -0.081528869 0.156682913 -0.112369201 -0.164556420 0.005660511 [31] -0.029230317 0.062539959 -0.151516899 -0.078637220 0.027241740 [36] -0.063743822 -0.000395207 -0.019109010 -0.015356528 -0.006720621 [41] -0.023425063 -0.063841417 -0.056311848 0.059259883 -0.015669404 [46] 0.065544271 -0.070894554 0.050897614 > 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/3ednj1290272102.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/40wmp1290272102.tab") > > try(system("convert tmp/1td6d1290272102.ps tmp/1td6d1290272102.png",intern=TRUE)) character(0) > try(system("convert tmp/2td6d1290272102.ps tmp/2td6d1290272102.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.590 0.331 1.284