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(102.8,106.3,103.7,106.9,104.3,105.4,96.2,95.7,95.9,93.6,94.7,94.5,96.6,96.7,98.9,102,105.2,106.4,99.3,96.4,93.1,95.6,93.3,96.7,105.6,105.2,107,104.9,104.5,105.2,99.7,100.2,98.5,98.4,97.1,98.4,100.6,111.3,119,117.8,108.8,109.3,103.5,103.7,110,105.5,110.4,106.7,110.2,105.2,108,108.1,107.2,106,99.4,100.2,100.3,100.8,99.5,100.2,103,111,120.5,109.5,106.6,105.5,103.9,104.9,104.8,99.6,97,95.4,99.3,103.9,107.4,107.4,111,113.2,108.5,113.3,113.8,105.3,107.5,109.4,118.9,119,115,124.1,120.5,117.7,117.1,118.1,119.6,118.8,124.9,124,124.9,121.7,121.6,125.1,127.9,129,130.1,130.3,127.9,124.1,125.7,129.2,129.2,132.6,131.5,131,125.8,127.2,127.3,127.5,122,118.4,118.3,115.5) > 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/1hy6i1290270182.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/2hy6i1290270182.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.002625473 -0.003593749 -0.129401587 -0.154043955 [6] -0.039806969 -0.179285710 0.074621457 -0.099271223 0.001928428 [11] -0.039931643 0.086823580 0.197731690 0.010010567 0.103499383 [16] 0.080150748 -0.092293132 -0.091116972 -0.090129478 -0.185333833 [21] -0.061474484 -0.066023062 0.134300991 0.198361574 0.157793091 [26] -0.027464087 -0.037169958 0.036885746 -0.106342133 -0.013560848 [31] -0.101273459 -0.104614680 -0.124237695 -0.057228879 0.096738140 [36] 0.003228322 0.193370641 -0.052319056 0.085900574 0.017671472 [41] -0.120211288 0.130397102 -0.180444552 -0.039198714 -0.183087880 [46] 0.013568837 0.085101193 0.071076640 0.116116955 > (mypacf <- c(rpacf$acf)) [1] 0.002625473 -0.003600666 -0.129385234 -0.156050713 -0.044954605 [6] -0.207783350 0.024615831 -0.154592346 -0.077474888 -0.116612554 [11] 0.038948557 0.120321602 0.001428659 0.077037090 0.178284665 [16] -0.042221937 0.002010729 0.013635162 -0.194976400 -0.054362766 [21] -0.105939346 0.032357004 0.129939300 0.111730595 -0.072183123 [26] -0.013280383 0.037758449 -0.033997844 -0.034655923 -0.057092230 [31] -0.063779976 -0.121050555 -0.048981438 0.004350105 -0.167598885 [36] 0.067450438 -0.159200817 -0.067119761 0.014184399 -0.105979919 [41] 0.157777087 -0.055347646 0.006953656 -0.107447555 -0.042301777 [46] -0.006267558 0.029578019 -0.052273845 > 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/3lh4o1290270182.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/46hlu1290270182.tab") > > try(system("convert tmp/1hy6i1290270182.ps tmp/1hy6i1290270182.png",intern=TRUE)) character(0) > try(system("convert tmp/2hy6i1290270182.ps tmp/2hy6i1290270182.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.553 0.308 1.180