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(6802.96,7132.68,7073.29,7264.5,7105.33,7218.71,7225.72,7354.25,7745.46,8070.26,8366.33,8667.51,8854.34,9218.1,9332.9,9358.31,9248.66,9401.2,9652.04,9957.38,10110.63,10169.26,10343.78,10750.21,11337.5,11786.96,12083.04,12007.74,11745.93,11051.51,11445.9,11924.88,12247.63,12690.91,12910.7,13202.12,13654.67,13862.82,13523.93,14211.17,14510.35,14289.23,14111.82,13086.59,13351.54,13747.69,12855.61,12926.93,12121.95,11731.65,11639.51,12163.78,12029.53,11234.18,9852.13,9709.04,9332.75,7108.6,6691.49,6143.05) > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '0' > par3 = '1' > par2 = '1' > par1 = '36' > #'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/1zhs81259953446.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/2ly871259953446.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.334061579 0.209709807 0.254108717 0.176134760 [6] 0.262376382 0.134597361 0.079583912 0.154307565 0.125837938 [11] 0.064304098 0.275237701 0.053336330 0.039876022 0.190973341 [16] 0.043356141 0.073499695 -0.055840626 -0.159063252 -0.002066898 [21] -0.057238197 -0.077848156 -0.124131668 -0.134330570 -0.119847451 [26] 0.003110157 -0.051753477 -0.035488276 0.026824452 -0.042157880 [31] -0.056716905 -0.087942976 -0.096919452 -0.157282078 -0.136184219 [36] -0.158793379 -0.083805751 > (mypacf <- c(rpacf$acf)) [1] 0.334061579 0.110437137 0.176506870 0.040519469 0.179539312 [6] -0.044785618 -0.019070097 0.064577447 0.032912408 -0.046610470 [11] 0.264101641 -0.150752675 -0.012435047 0.123287200 -0.065606354 [16] -0.048785603 -0.115624572 -0.158044296 0.016089007 -0.036696322 [21] 0.025899599 -0.180557204 0.035181254 -0.059295660 0.063208078 [26] 0.044088183 0.057794021 0.076272616 0.064099618 -0.141260390 [31] 0.022987196 -0.039433778 -0.096340045 -0.043050204 -0.076937251 [36] 0.005658182 > 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/311c31259953446.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/4693s1259953446.tab") > system("convert tmp/1zhs81259953446.ps tmp/1zhs81259953446.png") > system("convert tmp/2ly871259953446.ps tmp/2ly871259953446.png") > > > proc.time() user system elapsed 0.551 0.325 0.643