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(152.60,153.32,165.50,139.18,136.53,115.92,96.65,83.77,84.66,106.03,86.92,54.66,151.66,121.27,132.95,119.64,122.16,117.44,106.69,87.45,80.98,110.30,87.01,55.73,146.00,137.54,138.54,135.62,107.27,99.04,91.36,68.35,82.59,98.41,71.25,47.58,130.83,113.60,125.69,113.60,97.12,104.43,91.84,75.11,89.24,110.23,78.42,68.45,122.81,129.66,159.06,139.03,102.16,113.59,81.46,77.36,87.57,101.23,87.21,64.94,133.12,117.99,135.90,125.67,108.03,128.31,84.74,86.38,92.24,95.83,92.33,54.27) > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '1' > par3 = '1' > par2 = '1' > par1 = '36' > #'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/1kwne1261260306.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/2i4z71261260306.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.289935886 0.004479871 -0.079048623 -0.165417418 [6] 0.029871534 0.074990199 -0.065542620 -0.003795477 0.210389890 [11] -0.058637298 -0.036782687 -0.244544660 -0.073556237 0.015871986 [16] 0.308699863 -0.228834301 0.115699277 0.067636793 -0.175756731 [21] 0.208338399 -0.177679935 -0.106251473 0.137418559 0.124441903 [26] -0.024200016 0.156669972 -0.213191359 0.062377123 -0.010869641 [31] -0.083334801 -0.064816148 0.057349308 0.139929319 -0.078664922 [36] 0.137948249 -0.232273945 > (mypacf <- c(rpacf$acf)) [1] -0.289935886 -0.086886905 -0.113119893 -0.248892016 -0.132964816 [6] 0.003356925 -0.106922974 -0.125632462 0.193693402 0.097982128 [11] -0.040830518 -0.292892691 -0.223650693 -0.187477925 0.162035769 [16] -0.258623011 -0.120741765 0.119378010 -0.110499657 0.059326054 [21] -0.013030578 -0.110469103 -0.039174739 -0.040883614 -0.049001723 [26] 0.172813760 0.002289191 0.076220106 0.020539075 -0.064247450 [31] -0.044135069 -0.057994221 0.100139066 -0.033434303 -0.049127922 [36] 0.052335921 > 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/3dzq81261260306.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/41o001261260306.tab") > > try(system("convert tmp/1kwne1261260306.ps tmp/1kwne1261260306.png",intern=TRUE)) character(0) > try(system("convert tmp/2i4z71261260306.ps tmp/2i4z71261260306.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.555 0.318 0.719