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(408,407,406,404,402,401,402,404,405,405,406,408,405,400,402,404,410,402,400,392,390,397,394,397,400,395,391,392,395,386,385,372,367,364,364,368,370,357,350,353,353,348,337,322,315,316,317,326,329,310,301,299,300,295,274,258,250,247,248,256,253,237,225,214,221,221,207,194,191,185,180,185,189,179,162,148,152,151,134,122,119,115,113,109) > 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/rcomp/tmp/1c9kw1280760315.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/2c9kw1280760315.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.333763103 -0.230456967 -0.278009626 -0.053178825 [6] 0.223567547 0.284455281 0.158104542 0.004868099 -0.176352860 [11] -0.279309171 0.206878660 0.676517265 0.321262717 -0.084680824 [16] -0.310713419 -0.179422000 0.132802514 0.212513755 0.089986491 [21] 0.084156665 -0.143996889 -0.246052432 0.108108926 0.405579362 [26] 0.273871925 -0.055982229 -0.290287840 -0.217900933 0.076934276 [31] 0.069849123 0.018115238 0.059853656 -0.164693630 -0.164310709 [36] -0.017418745 0.156767783 0.158738228 -0.033834969 -0.225088955 [41] -0.158745502 0.018903555 -0.015223819 -0.001153689 0.024361313 [46] -0.103263918 -0.114230041 -0.087603453 0.010758808 > (mypacf <- c(rpacf$acf)) [1] 0.333763103 -0.384710706 -0.056926303 0.007451229 0.174590147 [6] 0.128632490 0.127980715 0.082656539 -0.117083003 -0.220628963 [11] 0.392239129 0.476907228 -0.084097708 0.162461123 -0.089641852 [16] -0.126820405 -0.096892495 -0.082744066 -0.127442965 0.155486228 [21] -0.083066746 0.121890670 0.017348708 -0.018171546 -0.052721250 [26] -0.152489712 0.037730906 -0.067249511 0.023530183 -0.101910811 [31] -0.030178517 -0.082867537 -0.110129047 0.054619351 -0.148599419 [36] -0.067179958 -0.033283177 0.007054526 0.088105566 0.083505675 [41] 0.005122764 0.077107152 -0.078189581 0.065990338 -0.040769094 [46] -0.085923006 -0.008854186 -0.068134407 > 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/3ya121280760315.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/4jsz81280760315.tab") > > try(system("convert tmp/1c9kw1280760315.ps tmp/1c9kw1280760315.png",intern=TRUE)) character(0) > try(system("convert tmp/2c9kw1280760315.ps tmp/2c9kw1280760315.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.569 0.304 1.146