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(228,136,174,69,108,149,134,131,180,127,59,59,202,173,296,154,117,86,38,17,52,12,61,65,70,91,111,90,110,100,99,137,139,124,103,75,55,75,65,17,27,17,20,131,26,66,59,35,57,6,24,57,42,55,30,35,22,18,22,82,90,66,64,50,56,99,97,41,59,92,91,47) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '1' > par2 = '1' > par1 = '60' > #'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/1rpxr1262181073.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/2gsef1262181073.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.3147056720 0.0797828088 -0.0824319741 -0.1738627243 [6] -0.0299958833 0.1374768741 -0.1547240168 0.1470381477 -0.0642103666 [11] 0.0667007925 -0.2293122946 0.1624250522 -0.2080222210 0.1499206907 [16] 0.0059782317 -0.0490682551 0.1056498308 0.0810935439 -0.0406485974 [21] 0.0732605092 -0.0598005809 -0.0803925779 0.1095570477 -0.0785481873 [26] -0.0732754343 0.0721259764 -0.0807159368 -0.0669007947 0.1923976014 [31] -0.1930544254 0.1728967515 -0.0691674302 -0.0101568235 0.0481959394 [36] -0.0228952672 -0.0187126870 0.0238925420 0.0658805530 0.0636901272 [41] -0.1043990970 0.0704272140 -0.1735501592 0.0903463266 -0.0781792799 [46] 0.0156601087 0.0955763493 -0.0105123148 0.0236408969 -0.0665528379 [51] -0.0829849700 0.0642346544 0.0288857122 0.0007732365 0.0152320356 [56] -0.0204029456 -0.0033647281 0.0388598524 -0.0051016758 -0.0960727368 [61] 0.0296229303 > (mypacf <- c(rpacf$acf)) [1] -0.314705672 -0.021373695 -0.070527711 -0.244584681 -0.188380907 [6] 0.078306325 -0.146952258 -0.026984046 -0.038506321 0.060095184 [11] -0.279316178 -0.001814660 -0.165241299 -0.048059719 -0.060639550 [16] -0.137955139 0.052087051 0.072480098 0.110207865 0.017700019 [21] 0.134426647 -0.073565546 0.173268089 -0.049364077 -0.062167136 [26] -0.016500512 -0.052339449 -0.128262092 0.095098303 -0.050953568 [31] 0.083947877 -0.027993361 -0.019762231 0.108042111 -0.126818400 [36] -0.010476087 -0.152749593 0.115659445 0.037834898 0.002359038 [41] -0.036541394 0.072967807 0.026567762 -0.071287541 0.071416749 [46] 0.030057476 0.094829391 -0.029677182 -0.051772937 -0.071074611 [51] 0.063296216 -0.029103797 -0.040011783 -0.013806009 -0.040549616 [56] -0.003489350 -0.032355823 0.041547657 -0.090516798 -0.098511862 > 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/3dgom1262181073.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/49bow1262181073.tab") > > try(system("convert tmp/1rpxr1262181073.ps tmp/1rpxr1262181073.png",intern=TRUE)) character(0) > try(system("convert tmp/2gsef1262181073.ps tmp/2gsef1262181073.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.609 0.334 1.542