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(100.00,110.08,123.28,106.30,114.60,110.22,117.82,138.84,131.13,153.26,148.76,110.75,132.00,138.55,126.50,119.47,152.49,152.46,134.08,162.33,130.46,142.83,148.39,122.88,125.86,133.31,140.97,110.30,123.04,125.99,112.24,136.10,111.86,109.63,135.75,114.39,121.79,101.33,147.01,113.01,101.89,117.85,128.68,117.27,121.55,109.18,127.88,104.92,100.93,116.79,107.50,109.18,128.31,83.80,93.16,103.99,106.33,97.55,111.71,105.43,103.62) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '1' > 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/1beu51261141238.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/2d0x41261141238.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.4062161550 -0.2674934055 0.3000093703 -0.0181350003 [6] -0.1403753027 -0.0208563634 0.1560006114 0.0080713678 -0.1964916911 [11] 0.2772873950 -0.1038713636 -0.2302805500 0.2833639962 -0.1121403114 [16] -0.0497394912 0.0290573251 0.0529284190 -0.0761758440 0.0888555103 [21] -0.0502592851 -0.0425949625 0.0474043829 0.1101515612 -0.2533149518 [26] 0.1106559263 0.1693034534 -0.1270003874 -0.0695579589 0.1207067769 [31] 0.0107442563 -0.1654510294 0.0609599056 0.0788528662 -0.0796549795 [36] 0.0132826007 0.1083037906 -0.1053256092 -0.0613605276 0.0614379835 [41] 0.0264836058 -0.0403272751 -0.0033063434 0.0138543142 0.0150641627 [46] -0.0171708264 -0.0053167027 -0.0003632641 > (mypacf <- c(rpacf$acf)) [1] -0.406216155 -0.517977198 -0.123322092 -0.038175904 -0.038667443 [6] -0.182698635 -0.027277415 0.104244152 -0.051413723 0.246440923 [11] 0.061240108 -0.150129659 0.032274431 -0.125213975 -0.008715231 [16] -0.112005230 -0.055523347 -0.187890566 0.171963678 -0.016901375 [21] -0.021240469 0.079654987 0.155521610 -0.139085631 0.002754546 [26] 0.055405315 0.084431038 0.046781456 -0.002998471 -0.021616196 [31] -0.020697224 -0.124208610 -0.141892262 -0.034505223 0.017238351 [36] -0.033731237 0.096548807 -0.056581851 -0.024789701 -0.035968185 [41] 0.119297162 -0.020884243 -0.023900643 -0.128712713 -0.074049389 [46] 0.008033450 0.018365149 > 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/3qy1h1261141238.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/466241261141238.tab") > > try(system("convert tmp/1beu51261141238.ps tmp/1beu51261141238.png",intern=TRUE)) character(0) > try(system("convert tmp/2d0x41261141238.ps tmp/2d0x41261141238.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.604 0.324 0.764