R version 2.8.0 (2008-10-20) Copyright (C) 2008 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(2,2.4,1.5,1.2,1.5,0.6,2.7,3.7,4.9,6.6,7.4,7.2,5.3,4.7,6.1,6.6,7,7.5,6.6,7.8,4.7,5.4,4.3,4.5,5.8,4.6,5.2,3.6,4.8,6.7,6.3,4.8,8.7,6.8,7.4,9,7.9,9.1,8.7,9.8,6.4,6.1,4.7,4.8,4.2,2.8,6.1,5.8,4.9,4.6,4.1,3.6,5.9,4.5,4.8,5.7,5,7,4.6,2.6,5,4.1,3.2,0,2.3,3.8,4.5,5.9,5,4.2,4.5,6) > 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/freestat/rcomp/tmp/1x6it1272892862.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/freestat/rcomp/tmp/2x6it1272892862.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.267548561 -0.010397530 0.028402144 -0.142261901 [6] 0.126480348 -0.141549195 0.034518279 -0.044032595 0.072677068 [11] -0.035813815 0.085660781 -0.297889745 0.031511258 0.066314655 [16] 0.039435035 -0.114011671 -0.103241820 0.256423512 -0.109820808 [21] 0.166120603 -0.071378926 0.067670309 0.135197001 -0.201100896 [26] 0.118555861 -0.110757804 -0.113699159 0.196384674 -0.004679291 [31] -0.074960016 -0.033749933 0.024890037 0.013778394 -0.185213224 [36] -0.038372074 0.108783318 -0.039039100 0.122395514 -0.009768866 [41] -0.055984895 0.055996482 -0.027944143 0.102862428 -0.132734242 [46] -0.017094650 0.065362652 -0.032843453 0.018929919 > (mypacf <- c(rpacf$acf)) [1] -0.2675485611 -0.0883005103 0.0018997253 -0.1459014001 0.0538165615 [6] -0.1176057713 -0.0260110594 -0.0835747559 0.0695317531 -0.0510683929 [11] 0.1066752756 -0.3314235877 -0.0906136935 -0.0515237258 0.1371096798 [16] -0.2586145434 -0.1239392172 0.0974896265 0.0266017682 0.0689967934 [21] 0.0355844326 0.1158927859 0.2121951068 -0.2012402142 0.0173688657 [26] -0.0024921229 -0.0840401520 0.0049985338 -0.0003471982 0.0490050786 [31] -0.0724292582 0.0618782469 -0.0172585845 -0.1460117999 -0.0343993652 [36] -0.0020984178 -0.0445602345 0.0715794659 -0.0051261463 -0.0765283046 [41] -0.0351688043 0.0518060775 -0.0588901520 -0.0472802566 -0.0161837617 [46] -0.0984702712 -0.0656192600 -0.0317836820 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/html/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/3tyy21272892862.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/freestat/rcomp/tmp/447f51272892862.tab") > > try(system("convert tmp/1x6it1272892862.ps tmp/1x6it1272892862.png",intern=TRUE)) character(0) > try(system("convert tmp/2x6it1272892862.ps tmp/2x6it1272892862.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.801 0.410 0.927