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(90.2 + ,90 + ,88.8 + ,85.8 + ,84.2 + ,80 + ,77.8 + ,76.8 + ,86.4 + ,89.2 + ,86.2 + ,84.6 + ,83.2 + ,83.2 + ,82.6 + ,79.8 + ,77.2 + ,74.8 + ,73 + ,73 + ,83.6 + ,85.6 + ,84.8 + ,84.2 + ,83.4 + ,84.6 + ,84.6 + ,83.8 + ,81.2 + ,79.6 + ,78 + ,78.2 + ,88.8 + ,92 + ,91 + ,91.2 + ,90.4 + ,91.8 + ,92.2 + ,90.2 + ,88.6 + ,87.8 + ,86 + ,87.2 + ,97.6 + ,101.2 + ,100.4 + ,100.2 + ,100.2 + ,103 + ,104.2 + ,104 + ,102.4 + ,101.8 + ,101 + ,102.2 + ,114 + ,118.4 + ,118.8 + ,117.2 + ,117.2 + ,118.4 + ,118.8 + ,117.2 + ,114.4 + ,112.6 + ,111 + ,110.8 + ,120.2 + ,124.4 + ,123.4 + ,121.2 + ,119 + ,119.8 + ,120 + ,118.4 + ,115 + ,113.4 + ,111 + ,111 + ,121.6 + ,126.2 + ,125.8 + ,124.8 + ,122 + ,123.2 + ,124.2 + ,120.8 + ,116.8 + ,114.8 + ,111 + ,109 + ,119.8 + ,124 + ,121.6 + ,118 + ,115.8 + ,116 + ,115.8 + ,114.4 + ,112 + ,110.2 + ,107.4 + ,108.2 + ,117.6 + ,121.4 + ,119.8 + ,115.6 + ,112.6 + ,113.2 + ,112.2 + ,110.8 + ,108 + ,105.2 + ,102.4 + ,101 + ,110.8 + ,116.8 + ,113.8 + ,108 + ,104.4 + ,105.2 + ,105.4 + ,103.2 + ,100.6 + ,97.8 + ,95.8 + ,95 + ,104.8 + ,110.4 + ,106.4 + ,102.2 + ,98.4 + ,98.4 + ,98.6 + ,96.2 + ,92.4 + ,91.4 + ,88.4 + ,87.8 + ,97.6 + ,104.2 + ,100.2 + ,97 + ,92.8 + ,92 + ,93.4 + ,92 + ,89.6 + ,88.6 + ,87.2 + ,86.2 + ,96.8 + ,102 + ,102.6 + ,100.6 + ,94.2 + ,94.2 + ,95.2 + ,95 + ,94 + ,92.2 + ,91 + ,91.2 + ,103.4 + ,105 + ,104.6 + ,103.8 + ,101.8 + ,102.4 + ,103.8 + ,103.4 + ,102 + ,101.8 + ,100.2 + ,101.4 + ,113.8 + ,116 + ,115.6 + ,113 + ,109.4 + ,111 + ,112.4 + ,112.2 + ,111 + ,108.8 + ,107.4 + ,108.6 + ,118.8 + ,122.2 + ,122.6 + ,122.2 + ,118.8 + ,119 + ,118.2 + ,117.8 + ,116.8 + ,114.6 + ,113.4 + ,113.8 + ,124.2 + ,125.8 + ,125.6 + ,122.4 + ,119 + ,119.4 + ,118.6 + ,118 + ,116 + ,114.8 + ,114.6 + ,114.6 + ,124 + ,125.2 + ,124 + ,117.6 + ,113.2 + ,111.4 + ,112.2 + ,109.8 + ,106.4 + ,105.2 + ,102.2 + ,99.8 + ,111 + ,113 + ,108.4 + ,105.4 + ,102 + ,102.8 + ,103.4 + ,101.6 + ,98.6 + ,98 + ,93.8 + ,95.6 + ,105.6 + ,106.8 + ,103.6 + ,101.2 + ,100.4 + ,103.2 + ,105.6 + ,106.6 + ,107.2 + ,107.4 + ,104.8 + ,107.2 + ,117.4 + ,119.4 + ,116.2 + ,112.8 + ,111.6) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '1' > par1 = 'Default' > #'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/1iqc51261302395.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/2o49p1261302395.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.0000000 0.9550692 0.8830927 0.8286534 0.7990379 0.7893528 0.7768433 [8] 0.7509981 0.7211794 0.7140512 0.7328634 0.7694562 0.7799841 0.7152472 [15] 0.6263236 0.5544458 0.5085675 0.4837135 0.4580341 0.4211047 0.3811768 [22] 0.3640098 0.3712955 0.3956913 0.3947858 > (mypacf <- c(rpacf$acf)) [1] 0.955069238 -0.330869832 0.283559494 0.106651513 0.153903544 [6] -0.088825500 -0.012946354 0.043714960 0.284145313 0.123037211 [11] 0.243895184 -0.334360401 -0.737170418 0.046703172 -0.029508431 [16] 0.052571477 0.100072597 0.004471487 0.089159915 0.002571215 [21] -0.052490736 -0.099522183 -0.008027982 -0.060743067 > 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/37z8v1261302395.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/457n21261302395.tab") > > try(system("convert tmp/1iqc51261302395.ps tmp/1iqc51261302395.png",intern=TRUE)) character(0) > try(system("convert tmp/2o49p1261302395.ps tmp/2o49p1261302395.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.543 0.300 0.739