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(80,79,78,76,74,73,74,76,77,77,78,80,90,90,89,82,78,76,74,78,81,82,88,99,117,113,106,100,97,96,100,104,104,111,117,118,140,147,134,126,116,114,120,122,117,119,132,134,154,152,132,130,123,129,124,128,128,129,141,138,155,160,142,133,131,140,134,134,134,136,145,137,152,168,160,157,147,161,159,164,163,158,175,163) > 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/11sls1282047378.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/2u12v1282047378.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.040178571 -0.076078869 -0.123697917 -0.225818452 [6] 0.079799107 -0.224330357 -0.016555060 -0.277529762 -0.002232143 [11] 0.021391369 -0.050595238 0.689360119 0.161458333 -0.053385417 [16] -0.123511905 -0.221726190 0.043340774 -0.134114583 -0.022321429 [21] -0.272321429 -0.061197917 0.120721726 -0.036086310 0.496093750 [26] 0.130208333 -0.083519345 -0.082589286 -0.156994048 0.030877976 [31] -0.125372024 0.015811012 -0.189918155 -0.073474702 0.106212798 [36] -0.014136905 0.313058036 0.130580357 -0.104538690 -0.072916667 [41] -0.059523810 0.052269345 -0.062686012 -0.034412202 -0.085379464 [46] -0.018973214 0.096168155 -0.052083333 0.114397321 > (mypacf <- c(rpacf$acf)) [1] 0.040178571 -0.077818811 -0.118181966 -0.227272910 0.076653091 [6] -0.301102231 -0.044174664 -0.439145458 -0.036308681 -0.386252625 [11] -0.230789279 0.509687285 0.179798442 -0.093616121 0.103769116 [16] -0.039608794 -0.084218979 -0.006703663 0.046983940 -0.015131321 [21] -0.125551025 -0.003814055 0.006570535 0.010038688 -0.163355664 [26] -0.125084314 -0.053953257 -0.038142098 -0.092046753 -0.040028675 [31] 0.024140040 0.023860117 -0.034415407 -0.084770403 0.042462965 [36] -0.192589014 -0.090115487 -0.113083493 0.002923135 -0.033552276 [41] -0.002900351 0.028831378 -0.052413700 0.001270518 0.132108983 [46] -0.022721124 -0.072806985 -0.095393238 > 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/3xkjj1282047378.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/4j2h71282047378.tab") > > try(system("convert tmp/11sls1282047378.ps tmp/11sls1282047378.png",intern=TRUE)) character(0) > try(system("convert tmp/2u12v1282047378.ps tmp/2u12v1282047378.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.566 0.316 0.848