R version 2.10.1 (2009-12-14) 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(178600 + ,181600 + ,178500 + ,176700 + ,183500 + ,175900 + ,179800 + ,186500 + ,182700 + ,182800 + ,178600 + ,183300 + ,182900 + ,191400 + ,189300 + ,192200 + ,187900 + ,193900 + ,189100 + ,193100 + ,194800 + ,200200 + ,211500 + ,202100 + ,200300 + ,199200 + ,204900 + ,207300 + ,200000 + ,197700 + ,202200 + ,200200 + ,208300 + ,215100 + ,210700 + ,208100 + ,209000 + ,211000 + ,210200 + ,205500 + ,211400 + ,211700 + ,209300 + ,207500 + ,203300 + ,207100 + ,206900 + ,228700 + ,226900 + ,265000 + ,227100 + ,228100 + ,226500 + ,225200 + ,217800 + ,221300 + ,215300 + ,231300 + ,227100 + ,237800 + ,230200 + ,233400 + ,231100 + ,237200 + ,243700 + ,239700 + ,248400 + ,241000 + ,254500 + ,242800 + ,268300 + ,253900 + ,262100 + ,264100 + ,261000 + ,269300 + ,260400 + ,263200 + ,279200 + ,272200 + ,269200 + ,289600 + ,283200 + ,284300 + ,283000 + ,289100 + ,289600 + ,289100 + ,287400 + ,279600 + ,289300 + ,295000 + ,299600 + ,293600 + ,294400 + ,290200 + ,301000 + ,307900 + ,298800 + ,310300 + ,293900 + ,305000 + ,311300 + ,317300 + ,296200 + ,306800 + ,291800 + ,301900 + ,314600 + ,321500 + ,329400 + ,311700 + ,309700 + ,306500 + ,307100 + ,301300 + ,292200 + ,310100 + ,316800 + ,284400 + ,284600 + ,301200 + ,287600 + ,314300 + ,298200 + ,299400 + ,301900 + ,265500 + ,287100 + ,274000 + ,290100 + ,263100 + ,245200 + ,258600 + ,259800 + ,269800 + ,274600 + ,274800 + ,271100 + ,257800 + ,290300 + ,262200 + ,270000 + ,290600) > 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/rcomp/tmp/1pmhd1272638546.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/rcomp/tmp/2pmhd1272638546.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.462692604 0.126822813 -0.078763463 -0.079115731 [6] 0.099582028 -0.071622960 0.075842414 0.017589438 -0.059978703 [11] 0.023073413 -0.020143920 0.042771414 0.031523725 -0.082927353 [16] 0.106241109 -0.022363618 -0.006472501 -0.046943352 0.033470956 [21] -0.043070792 0.060097458 -0.008353280 -0.001499193 -0.080545442 [26] -0.014978748 0.062024412 0.102990063 -0.093215368 0.026136525 [31] -0.061698929 -0.026123465 0.042532505 0.033175499 -0.056582255 [36] 0.049436383 -0.059700053 0.039390540 0.008717548 -0.021240391 [41] 0.020449786 -0.084724353 0.033886929 0.005778119 0.017769470 [46] 0.029761215 -0.050391933 -0.069696697 0.123710657 > (mypacf <- c(rpacf$acf)) [1] -0.4626926040 -0.1110318182 -0.0836633659 -0.1809973972 -0.0247775717 [6] -0.0449846585 0.0143056125 0.0746373052 -0.0100715056 -0.0178887498 [11] 0.0026669352 0.0420990434 0.0780034714 -0.0391951314 0.0645303241 [16] 0.1001425098 0.0386617628 -0.0557819876 0.0102841785 -0.0513396151 [21] 0.0168076255 0.0303808319 -0.0067763877 -0.1213966394 -0.1169647688 [26] 0.0011787040 0.1605024910 -0.0113423511 -0.0250664203 -0.0309390484 [31] -0.0705367333 -0.0181530685 0.0759022832 -0.0848817955 -0.0098856188 [36] 0.0068458891 0.0281794842 0.0236944955 0.0004099873 0.0070961198 [41] -0.0701820062 -0.1067978371 -0.0200926285 0.0307700926 0.0546996657 [46] 0.0209914194 -0.1201174446 -0.0062470425 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/rcomp/tmp/3smxj1272638546.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/rcomp/tmp/4v5wp1272638546.tab") > > try(system("convert tmp/1pmhd1272638546.ps tmp/1pmhd1272638546.png",intern=TRUE)) character(0) > try(system("convert tmp/2pmhd1272638546.ps tmp/2pmhd1272638546.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.200 2.040 9.624