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 = '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/1r0j01290271763.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/2r0j01290271763.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.899732110 0.771527685 0.634366508 0.497930401 [6] 0.378682728 0.284513959 0.241228070 0.191843060 0.141391770 [11] 0.083775078 0.024367036 -0.027875605 -0.071161494 -0.095467599 [16] -0.107234253 -0.129023937 -0.137549100 -0.139975140 -0.161039755 [21] -0.174938968 -0.168067048 -0.172668300 -0.177610761 -0.172530191 [26] -0.138745364 -0.091696015 -0.044987875 -0.013676818 0.015117819 [31] 0.061825959 0.083412543 0.100691356 0.105430716 0.121984459 [36] 0.138879411 0.148608962 0.148656690 0.137231247 0.136553905 [41] 0.121204551 0.098689796 0.089780773 0.073706349 0.069105097 [46] 0.060921144 0.047704350 0.020156753 -0.006665773 > (mypacf <- c(rpacf$acf)) [1] 0.8997321099 -0.1994422506 -0.1028051291 -0.0711770983 0.0029801630 [6] 0.0297193768 0.1703868776 -0.1544063863 -0.0603689269 -0.0856319276 [11] -0.0211558562 0.0129267200 0.0247628214 -0.0110117402 -0.0071042084 [16] -0.1360839033 0.0635419109 0.0174308349 -0.1193098542 0.0368333267 [21] 0.0788710672 -0.1686266671 0.0275121876 0.0288195351 0.1152795600 [26] 0.0843323759 -0.0006082959 -0.1560753115 0.0630596620 0.1707072344 [31] -0.0495205483 0.0023900176 -0.0987198517 0.0908488421 0.0356879615 [36] 0.0073549961 -0.0407828065 -0.0283575946 0.0364928105 0.0024844923 [41] -0.0470917980 0.0636786239 -0.0454249914 0.0657866458 -0.0312613485 [46] -0.0160476320 -0.1421277445 0.0616679538 > 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/3d0i61290271763.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/4g0gb1290271763.tab") > > try(system("convert tmp/1r0j01290271763.ps tmp/1r0j01290271763.png",intern=TRUE)) character(0) > try(system("convert tmp/2r0j01290271763.ps tmp/2r0j01290271763.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.565 0.309 1.200