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(194.9,195.5,196,196.2,196.2,196.2,196.2,197,197.7,198,198.2,198.5,198.6,199.5,200,201.3,202.2,202.9,203.5,203.5,204,204.1,204.3,204.5,204.8,205.1,205.7,206.5,206.9,207.1,207.8,208,208.5,208.6,209,209.1,209.7,209.8,209.9,210,210.8,211.4,211.7,212,212.2,212.4,212.9,213.4,213.7,214,214.3,214.8,215,215.9,216.4,216.9,217.2,217.5,217.9,218.1,218.6,218.9,219.3,220.4,220.9,221,221.8,222,222.2,222.5,222.9,223.1) > 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/1vpga1291666388.ps",horizontal=F,onefile=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/2vpga1291666388.ps",horizontal=F,onefile=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.144163108 0.114767438 -0.047312521 -0.038607123 [6] -0.123432960 0.093164255 -0.035003459 -0.041580568 0.024811988 [11] 0.057732220 -0.164884826 -0.295978977 0.038020021 -0.054571395 [16] 0.017731416 -0.022815319 0.097132954 -0.077092677 0.103526573 [21] 0.010571743 -0.097952499 -0.223404173 0.084868954 -0.155555368 [26] 0.001748017 -0.070396591 -0.018904001 -0.066106947 0.010690720 [31] 0.049272556 -0.001449765 0.040498431 0.064907130 -0.027550397 [36] -0.077890177 0.006692195 > (mypacf <- c(rpacf$acf)) [1] 0.1441631076 0.0959791715 -0.0784443290 -0.0341876671 -0.1034444065 [6] 0.1339632871 -0.0477873764 -0.0734276055 0.0572097877 0.0534679097 [11] -0.1846250585 -0.3152782124 0.2008595122 0.0147325493 -0.0846239839 [16] -0.1169030489 0.1744469165 0.0104455224 -0.0668892418 -0.0167929016 [21] -0.0280144357 -0.1964813402 -0.0031874468 -0.1722524578 0.0899416544 [26] -0.1486703127 -0.0740068964 0.0084212556 0.0005421419 0.0337201043 [31] 0.0061020043 0.0212722298 -0.0727819303 -0.1722233875 0.0008781813 [36] -0.1153350385 > 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/3lblm1291666388.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/4kqv41291666388.tab") > > try(system("convert tmp/1vpga1291666388.ps tmp/1vpga1291666388.png",intern=TRUE)) character(0) > try(system("convert tmp/2vpga1291666388.ps tmp/2vpga1291666388.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.555 0.328 1.176